Turn a Placeholder Into an Abstract Method
easyQuestion 542Sensor is an abstract class, but its read() method is still an ordinary method with a made-up body that returns 0.0. A method that only subclasses can answer should be declared abstract: a header that ends in a semicolon, with no body at all. Then the compiler makes every subclass write its own read().
Requirements:
1. Replace the placeholder read() with an abstract method that has the same name, is public, takes no parameters and returns a double.
2. Leave the constructor, getLabel() and status() as they are. status() keeps calling read().
3. The tests bring their own subclasses, such as a Thermometer whose read() returns 21.5. They print status(), and they also check that read() is declared abstract.
Do NOT write a main method.
Expected output
Thermometer: 21.5 read is abstract: true
= newline. The output ends with a newline, so print one after the last line.
Your output
Run your code to see the output here...