From my code I want my bedroom class to inherit length and breadth from the superclass - room. I have filled the errors in the respective lines within comments. I am getting
Bedroom
is not valid name for constructor in BedRoom
class. void
from it.In other words replace
public void Bedroom(int x, int y, int z) {
// ^^^^ ^
with
public BedRoom(int x, int y, int z) {
Change to
public void BedRoom(int x,int y,int z)
As for java Bedroom is not same as BedRoom
You have simply misspelled BedRoom
as Bedroom
in the constructor declaration. (Correcting this would give you a more simple-to-understand error message about the problem that @HovercraftFullOfEels mentions: constructors do not have a return type.)
Your BedRoom class has a pseudo-constructor not a real constructor. Constructors don't return anything, not void not anything. Get rid of that void statement.
Change
public void Bedroom(int x,int y,int z)
to
public BedRoom(int x,int y,int z) // also capitalize correctly