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
Post a Comment