Question: (A) Create a Java class named House that contains the following: 1. Two private instance variables: area of type integer numberOfFloors of type integer

(A) Create a Java class named House that contains the following: 1.

  

(A) Create a Java class named House that contains the following: 1. Two private instance variables: area of type integer numberOfFloors of type integer 2. A parameterized constructor to initialize its parameterized to the instance variables. 3. Accessors and mutators for the two instance variables. 4. A toString method that returns the details of a house. (B) Create a Java class named Person that contains the following: (C) 1. Two private instance variables: name of type String house of type House 2. A constructor with four parameters to initialize the instance variables name and house. 3. A toString method that returns the details of a house. create an object of type Person and initialize it with proper data of your choice and print the object details on screen.

Step by Step Solution

3.31 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

A Java class House java public class House private int area private int numberOfFloors public Housei... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!