Question: Create an abstract class called Building. The class should have private int fields to store the building s height and width. These variables should be
Create an abstract class called Building. The class should have private int fields to store the
buildings height and width. These variables should be initialized by the constructor. Height and width are measured in characters Add methods getHeight and getWidth that return the values of the private fields.
Add an abstract method getLevel that returns String and takes an int parameter. In subclasses,
this method will return a string representing one level of the building.
Add a toString method that uses getLevel to produce a string representing the building
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
