All Courses
Abstract Class in Java Language

Abstract Class in Java

May 1st, 2019 Java

Abstract Class in Java

Abstract class is a class which has any or all methods having the declaration only, but not the full functionality written then the whole class itself becomes abstract class.

The class which extends these type of abstract class can write the full funtionality of the methods.

Ways to achieve abstraction in java

Abstract class (0 to 100%)

Interface (100%)

Example :

abstract class Bike
{
abstract void run();
}
class  Bajaj extends Bike
{
void run()
{
System.out.println("running safely");
}
public static void main(String args[]);
{
Bike obj = new Bajaj();
obj.run();
}
}
Output : running safely
Social Share:

0 responses on "Abstract Class in Java"

Leave a Message

Your email address will not be published. Required fields are marked *