How will you define an abstract class?

How will you define an abstract class?

An abstract class have abstract modifier in its declaration. An abstract class can contain  instance variable, methods that can be concrete methods and abstract methods. An abstract class may not have any abstract method, that does not mean that it is not an abstract class.

Example :

public abstarct AbstractClass{
// instance variable
int a;
int b;
//instance methods
public int getValue(){}
public void setValue(int){}
//abstract method
public int getMaxValue();
}

By:Jalees
Date:2015-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher