Originally Posted by
pairenoid
... its starting to get harder with inheritance and polymorphism < still dont know what that is
Google for it, there are lots of explanations.
my question is why does it not say roomRate = 170 its instead rate ...
Common sense would suggest he made a typo.
also explain the super(number, stay) please i am confused. I am under the impression that super means your using the same number and stay as the main class or something? dont know..
'super' refers to the superclass. Calling super(number, stay) calls the superclass constructor so that 'number' and 'stay' are handled by the existing superclass code.
the class UpgradeRoom has only 1 new variable which is "protected int minimumStay;"
i dont get why its protected!
Using 'protected' makes it visible to subclasses and other classes in the same package. Normally you would use it when you expect a subclass to need access to it. Using it here implies that you may want to subclass UpgradeRoom at some point and set a different minimumStay value. Alternatively, it may be another mistake by your tutor, or he may have put it in there deliberately to make you think - why not ask him?