A class that is declared with abstract keyword, is known as abstract class in java. It can have abstract and non-abstract methods (method with body).
Syntax for abstract class:
abstract class A{}
Example of abstract class that has abstract method :
abstract class Car
{
abstract void run(); //abstract method
}
class Hyundi4 extends Car{
void run()
{
System.out.println("running safely..");
}
public static void main(String args[]){
Car obj = new Hyundi4();
obj.run();
}
}