1. Learn
  2. /
  3. Courses
  4. /
  5. Input/Output and Streams in Java

Connected

Exercise

Implementing method overriding

You will implement method overriding to modify inherited behavior. You will create a parent class Device and a subclass Phone that overrides a method.

Instructions

100 XP
  • Create Phone class inherited from parent class Device.
  • Override the .turnOn() method.
  • Create a new instance of Phone.
  • Calling the new method to print the message.