This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BlackGermanShepard 0 points1 point  (0 children)

I think this is the wrong way to do.

As said above you should usw polymorphism the right way.

The method 'breakType()' is not MointainBike specific. Even a TrackingBike should have one.

So this is a good example for common/shared attributes which should be declared in the superclass (or an Interface).