java - Why is having an abstract subclass of concrete class bad design? -


after java abstract abstract subclass of object. need force subclass implement methods, may have pretty defined hierarchy concrete classes.

for example: have functioning hierarchy vehicle<--- car

and want add electriccar hierarchy.

vehicle<--car<--electriccar.

i want different types of electric cars implement behaviors getbatterylife or something-

why bad idea make electriccar abstract ?

there's nothing wrong in making abstract. if business requires make abstract, it's fine. said, lots of classes in java lib abstract , still extending object.


Comments

Popular posts from this blog

jQuery clickable div with working mailto link inside -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -