Can i have abstract class with no abstract methods?

Answer Posted / mohan sahu

An abstract class without any abstract methods should be a
rare thing and you should always question your application
design if this case arises. Normally you should refactor to
use a concrete superclass in this scenario.
One specific case where abstract class may justifiably have
no abstract methods is where it partially implements an
interface, with the intention that its subclasses must
complete the interface. To take a slightly contrived
motoring analogy, a Chassis class may partially implement a
Vehicle interface and provide a set of core methods from
which a range of concrete Vehicle types are extended.
Chassis is not a viable implementation of a Vehicle in its
own right, so a concrete Car subclass would have to
implement interface methods for functional wheels, engine
and bodywork.

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What classes of exceptions may be thrown by a throw statement?

524


How do you replace all in word?

520


What is difference between call by value and call by reference?

498


What is the class in java?

555


Can we define constructor in inner class?

535






Tell us something about an iterator.

544


Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me

1358


What is meant by oops concept in java?

502


When is the arraystoreexception thrown?

566


Can java cast null?

595


How do you end a program?

542


Is empty string in java?

536


What is the difference between an inner class and a sub-class?

503


What is an empirical question?

537


Name four container classes.

552