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 anonymous inner class?
What do you mean by access modifier?
What is boolean law?
What are the types of methods in java?
What is the difference between a field variable and a local variable?
FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?
What is the difference between yielding and sleeping?
Can a java program have 2 main methods?
Explain the hierarchy of java exception classes?
Is java programming easy?
Is math an abstract class in java?
How objects of a class are created if no constructor is defined in the class?
Which method returns the length of a string?
Can java run on google chrome?
What is a finally block? Is there a case when finally will not execute?