You forgot to post the full text of the error messages.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
Your posted code doesn't match the error messages you posted.
I do NOT see any call to super() in your code.
If you were to add the call to super() you need to add a constructor to the "super" class (Room) that has that same number of parameters as in the super() call ( there are none).
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
Your error messages do not match the code you posted.
Do you know what a class constructor is?
Does the Room class have a constructor with no arguments?
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
In terms of Java language, Java requires that when you construct a new instance the constructors for the class and all its superclasses get run, superclasses first.
To achieve that either
1. You start your constructor with a call to a superclass constructor
or
2. The compiler inserts one for you at the start of your constructor. The call that the compiler inserts is a call to the default (no arguments) constructor of the superclass, ie super();
In your code you don't call a superclass constructor, so Java inserts a super();
But the superclass doesn't have a default (no args) constructor. so that's the error message you get.
In terms of design your problem is that in your subclass you think about initialising the extra fields for the subclass, but you forgot that you inherit from the Room class a bunch of variables that still need to be initialised.
Think on that for a while. If you still can't see a way to solve it come back here for some more hints.
JamesCherrill
Posting Genius
6,371 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073