Embed presentation
Downloaded 10 times

![classAdemo
{
public static void main(String arr[])
{
B b = new B();
C c = new C();
b.getB();
c.getC();
}
}
OUTPUT:-](https://image.slidesharecdn.com/overridingabstract-131127075552-phpapp02/75/Overriding-abstract-in-java-2-2048.jpg)

The document shows an example of method overriding using abstract methods. It defines classes A, B, and C where B and C extend class A. Class A contains a getA() method that prints a message. Classes B and C override this method by defining their own getB() and getC() methods, with B calling the superclass method and both printing additional messages. The main method creates instances of B and C and calls their respective methods to demonstrate method overriding.

![classAdemo
{
public static void main(String arr[])
{
B b = new B();
C c = new C();
b.getB();
c.getC();
}
}
OUTPUT:-](https://image.slidesharecdn.com/overridingabstract-131127075552-phpapp02/75/Overriding-abstract-in-java-2-2048.jpg)