abstract class BaseAbstractClass { abstract void baseMethod1(); // Definition done in DerivedClass class void baseMethod2() { System.out .println("baseMethod2() method called form BaseAbstractClass"); } } class DerivedClass extends BaseAbstractClass { void baseMethod1() { System.out .println("Defining the defination of abstract method baseMethod1()"); } } class AbstractExample2 { public static void main(String[] args) { DerivedClass b = new DerivedClass(); b.baseMethod1(); b.baseMethod2(); } } /* * Defining the definition of abstract method baseMethod1() * baseMethod2() method called form BaseAbstractClass */
Related Tags for Abstract class or methods example-3:
Ask Questions?
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.