//MAIN CLAUSE
package demo;
public class Main {
public static void main (String[] args) {
Sample remote = new TVRemote();
remote.turnon();
remote.turnoff();
}
}
//SUBCLASS****
package first;
abstract class Sample{
abstract void turnOn();
abstract void turnOff();
}
// Concrete class implementing the abstract methods
class TVRemote extends Sample {
@Override
void turnOn() {
System.out.println("TV is turned ON.");
}
@Override
void turnOff() {
System.out.println("TV is turned OFF.");
}
}
}
}
Top comments (0)