Share on Google+Share on Google+

An Abstract class may or may not have abstract method.

In this tutorial you will com to know how abstract class is used. Abstract Class do not instantiate.


An Abstract is also known as Abstract Base Class. Abstract Class do not instantiate it means no object is made of this class. Its method declaration is done in its derived class not in the abstract class. Abstract itself means incomplete so through inheritance it method method is defined.

Program Description:

In this example you are going to see that there is abstract class and a class derived class which extends the abstract class. In the BaseAbstractClass class there is a abstract method which is having no defination. It is defined under the DerivedClass class.  This all defined the working behavior of abstract class


abstract class BaseAbstractClass {

abstract void baseMethod1();

// defination 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 definition of abstract method baseMethod1()");



class Prog22 {

public static void main(String[] args) {

DerivedClass b = new DerivedClass();






Defining the definition of abstract method baseMethod1()
baseMethod2() method called form BaseAbstractClass



Posted on: March 22, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null