The output of the method will be 1 1 3 3 or 1 1 3 3? Brackets
Fantastic news! We've Found the answer you've been seeking!
Question:
public class Room {
int width;
int length;
public Room(int w, int l) {
this.width = w;
this.length = l;
}
public String toString() {
return width + " " + length;
}
}
public class House {
int nFloors;
int nRooms;
static int numHouses = 0;
Room[] allRooms;
public House(int n1, int n2) {
nFloors = n1;
nRooms = n2;
allRooms = new Room[nRooms];
numHouses++;
}
public void printRooms() {
for (int i = 0; i < this.nRooms; i++) {
System.out.print(this.allRooms[i] + " ");
}
}
public static House renovation(House h) {
return new House(1, 2);
}
}
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: