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

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -