That is how it is defined. That is the meaning of "abstract".
The reason you can't create an object of an abstract class is that an abstract class is defined as one you can't create an object of.
we cant use abstract class for creating objects ..because abstract class has atleast one or more abstract methods(method without definition )
but you can extend the abstract class by defining all the abstract methods in that and create the object by using the sub class..
one main thing in this is when you miss to define one or more abstract method ..your sub class also must be an abstract class..
saravanan ragunathan wrote:. . .because abstract class has atleast one or more abstract methods(method without definition ) . . .
As Rob has already said, that is not quote correct. The reason is that "abstract" means untouchable and not solid, so it is used in Java™ to mean "don't create any objects of this class".
You can actually create instances of an abstract class as an anonymous class, but that is a different story.
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad: