Residence Class

The constructor takes an int for number of rooms, an int for number of external walls, and a boolean for whether or not there is a washer.

Residence also has 4 methods:

As a reminder, public members and methods are accessible from any class, while private members and methods are only accessible from within the class in which they are declared. The protected keyword can be thought of as midway between public and private. Classes that do not either inherit from (using extends) a class with a protected item and do not exist in the same package may not access it. Because protected members are visible from anywhere in the same package, it is only more secure than public when multiple packages are used. (See this tutorial for more information.)

The output of toString() should be similar to the following.

Number of Rooms: 4
Number of Walls: 4
Washer: true
Number of Windows: 8
Property Value: 40000.0