Answers for "What are abstract classes? Write a program having student as an abstract class with some methods like input(), display() etc. and create the derived classes names Engineering and Medical from the Student class? Create the objects and process them"

2

abstract class example in java

//abstract parent class
abstract class Animal{
   //abstract method
   public abstract void sound();
}
//Dog class extends Animal class
public class Dog extends Animal{

   public void sound(){
	System.out.println("Woof");
   }
   public static void main(String args[]){
	Animal obj = new Dog();
	obj.sound();
   }
}
Posted by: Guest on November-11-2020

Code answers related to "What are abstract classes? Write a program having student as an abstract class with some methods like input(), display() etc. and create the derived classes names Engineering and Medical from the Student class? Create the objects and process them"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language