1. सीखें
  2. /
  3. पाठ्यक्रम
  4. /
  5. Input/Output and Streams in Java

Connected

अभ्यास

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.

निर्देश

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.