a. An anonymous class can be declared abstract. b. A local class can be declared abstract. c. An abstract class can be instantiated. d. An abstract class is implicitly final. e. An abstract class must declare at least one abstract method. f. An abstract class can not extend a concrete class.
ans is :b
i thought ans should be b and e.
why e is not the ans? if we dont have any abstract method in the abstract class then whats the use of making class abstract(if all the methods have their implementation)
Joined: Mar 28, 2006
To have such a class it's probably stupid, but that doesn't mean that is not legal.
Joined: Feb 02, 2006
An abstract class is not required to have an abstract method in it.
Any class that has an abstract method in it or that does not provide an implementation for any abstract methods declared in its superclasses or implemented interfaces must be declared as an abstract class.
Joined: May 14, 2006
The rule of thumb I use about abstraction and the relationship between classes and their methods is "Only abstract class can have abstract methods": once this is verified, everything else is possible. Hope I'm not wrong :-)
Joined: Feb 07, 2005
e is not correct because a class can simply be declared abstract even if it contains no methods.
Joined: Jun 08, 2005
Originally posted by Keith Lynn: e is not correct because a class can simply be declared abstract even if it contains no methods.