Inheritance not working

前端 未结 4 1600
伪装坚强ぢ
伪装坚强ぢ 2021-01-17 06:29

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

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-17 07:09

    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.)

提交回复
热议问题