Answer Posted / tarun
Abstract Class : An abstract class can not be initialized.
Any class can extends it. The methods declared in the
abstract class can be abstract or not.
Abstract Method : If any method is declared as abstract
method it should be in a abstract class. And it can be
override by any other class which is extending it. if method
is declared as abstract it should not contain body.
For Example:
public abstract class AbstractEx {
public void reset(){
System.out.println("The Sun Rises in the east");
}
public abstract void method();
protected abstract void newmethod();
}
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is java used for?
How many bytes are a float?
Can an interface implement another interface?
Explain the difference between string, stringbuffer and stringbuilder in java?
How to overcome the exception object reference not set to an instance of object?
What steps are taken when the OS shifts from one-thread execution to another?
Which methods cannot be overridden in java?
How to instantiate static nested classes in java?
What is a list in java?
Can an unreferenced object be referenced again?
What is exception in java?
What is a finally block? Is there a case when finally will not execute?
What is a local class in java?
What is the lifetime and scope of a variable?
Can private class be extended java?