What do you expect anyone to recommend from this little post?
Is this what you are trying to do>
You have an array list containing Room objects.
You have a loop that goes through the objects in...
Type: Posts; User: Norm
What do you expect anyone to recommend from this little post?
Is this what you are trying to do>
You have an array list containing Room objects.
You have a loop that goes through the objects in...
Where do you give r a value? Your code does not show where the r variable that is used in getStoreyRooms() is gettting a value.
You have the same problem in this code that you had before. You have...
Please copy and paste the FULL text of the error message.
There are many ways for r to be null.
Are you sure that this statement:
r = new RoomReference(1, 1, 1)
is executed BEFORE you try to...
RoomReference r = null; // define the variable here
public engine(String name,int budget)
{
s = new Storey();
o = new Owner(name, budget, budget);
h = new House();
r = new...
The r variable in the engine constructor is local to the constructor. You need to move its definition outside of the constructor.
Does the r variable have a valid value or is its value null?
Where do you give the r variable the address of a Room object?
Why are you trying to work with the String representation of the class? You should be working with the Room objects.
Where is the definition of z in the definition of those two classes you just posted?
If z is not defined in the class, how can you use z's value to "filter" an instance of the class?
Does your ArrayList in this example contain three elements? What data type are the elements?
Are they Strings? Like this: "1,1,2:2,2,2:RoomC"
Or is 1,1,2:2,2,2:RoomC a representation of the...