Checking changes to an override

A monitoring application contains the following Java classes. Consider each proposed change independently, starting from this original code. Which statements are correct? Select all that apply.


Java
class Sensor {
    public int read(int count) {
        return count;
    }
}

class AdjustedSensor extends Sensor {
    @Override
    public int read(int count) {
        return count + 2;
    }
}
Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Method Overriding Questions: