Embed presentation
Download to read offline





![Example Program:
abstract class Bike{
abstract void run();
}
class Honda4 extends Bike{
void run(){System.out.println("running safely..");
}
public static void main(String args[]){
Bike obj = new Honda4();
obj.run();
}
}](https://image.slidesharecdn.com/abstractclass-171219100315/75/Abstract-class-6-2048.jpg)


An abstract class in Java is a class declared with the abstract keyword. It can contain both abstract and non-abstract methods, with abstract methods having no body. Abstract classes focus on what an object does rather than how, hiding implementation details. They must be extended and have their abstract methods implemented before being instantiated. For example, an abstract Bike class declares an abstract run() method, and a Honda4 class extends Bike and provides a run() method body.





![Example Program:
abstract class Bike{
abstract void run();
}
class Honda4 extends Bike{
void run(){System.out.println("running safely..");
}
public static void main(String args[]){
Bike obj = new Honda4();
obj.run();
}
}](https://image.slidesharecdn.com/abstractclass-171219100315/75/Abstract-class-6-2048.jpg)
