What is an abstract class and abstract method?
Answers were Sorted based on User's Feedback
Answer / nikhlesh gupta datia(m.p.)
Abstract Method:- The method which is define in the class without bodies that is without implementation is call as Abstract Method. & all the Abstract Method must be define with abstract keywords.
Abstract Class:- The class which is define with some abstract method is called as Abstract Class. & all the Abstract Method must be define with abstract keywords. We cannot created the object of abstract class.
| Is This Answer Correct ? | 18 Yes | 2 No |
Abstract class is a class which contains atleast one
abstract method in it.OTHER methods maybe abstract or
concrete.
| Is This Answer Correct ? | 15 Yes | 0 No |
Answer / 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 |
Answer / priyanka tiwari
abstract class contains abstract method and if method will
be abstract the class should be abstract class.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / ravikiran(aptech mumbai)
abstract class contains abstract as well as non abstarct
methods,And the class cann't get instantiated.
abstarct method is the one which must get override in the
subclass
| Is This Answer Correct ? | 4 Yes | 1 No |
What is a protected class in java?
What are the Class Libraries ?
What is clipping and repainting and what is the relation between them?
Does garbage collection occur in permanent generation space in jvm?
What is integers and example?
Can private class be extended java?
what is the difference between applet and swing and gui application in java . What we do with the collections set and list interface
2 Answers CTS, Phoenix Technologies,
How do you start a thread?
Explain the difference between scrollbar and scrollpane?
What do you understand by abstract classes?
When you declare a method as abstract method ?
how we can write the string concatenation program in java.