abstract in java


abstract class Template{

abstract void pow();
abstract void add();
abstract void sub();

}

 abstract class Rithik extends Template{
 void add(){
  System.out.println("add");
  
  }
 
 }

abstract class Prem extends Rithik{

 void sub(){
  System.out.println("sub");
  
  }
}
class Manager extends Prem{
 void pow(){
  System.out.println("pow");
  
  }


}

class Test{


 public static void main(String ar[]){
 
  Manager objManager=new Manager();
  objManager.add();
  objManager.sub();
  objManager.pow();
 
 }

}

Reactions:

0 comments:

Post a Comment