On Oct 14, 10:06 am, Plinio <plinio.ga...@gmail.com> wrote: > Hi, > > In the LAB-1023 Homework I have to write the getSalePrice() method for > the Ford sub class, this method subtract the manufacturerDiscount from > the sale price computed from Car class. > > The problem is that the sale price from Car class is computed by > Car.getSalePrice() and I can't use this method in the > Ford.getSalePrice() because it is ovverided by himself. > > I have to write a new method even if it is not indicated in the > specifications ? Yes, you user super to retrieve the getSalePrice method of car, and then make the necessary modification to get what you want. (Note you will also use this to get the discount).
> > What are the specifications for Car.getSalePrice() method ? None, it is just a place holder so that you can adapt it to your need in each class which extends Car class. This is precisely the mechanism of inheritance in action. Michèle Garoche -- To post to this group, send email to javaprogrammingwithpassion@googlegroups.com To unsubscribe from this group, send email to javaprogrammingwithpassion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en