Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    21
    Views
    4,149

    Re: Java help, passing/filtering a array

    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...
  2. Replies
    21
    Views
    4,149

    Re: Java help, passing/filtering a array

    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...
  3. Replies
    21
    Views
    4,149

    Re: Java help, passing/filtering a array

    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...
  4. Replies
    21
    Views
    4,149

    Re: Java help, passing/filtering a array

    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...
  5. Replies
    21
    Views
    4,149

    Re: Java help, passing/filtering a array

    The r variable in the engine constructor is local to the constructor. You need to move its definition outside of the constructor.
  6. Replies
    21
    Views
    4,149

    Re: Java help, passing/filtering a array

    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?
  7. Replies
    21
    Views
    4,149

    Re: Java help, passing/filtering a array

    Why are you trying to work with the String representation of the class? You should be working with the Room objects.
  8. Replies
    21
    Views
    4,149

    Re: Java help, passing/filtering a array

    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?
  9. Replies
    21
    Views
    4,149

    Re: Java help, passing/filtering a array

    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...
Results 1 to 9 of 9