Merging arrays or returning multiple arrays

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kliopatraisis
    New Member
    • Sep 2008
    • 1

    Merging arrays or returning multiple arrays

    I think I've been working on this assignment for too long and my brain has stopped making connections!

    Basically, we are making a very simple version of AutoCAD, called HomeCAD. The problem I am having is this:
    Each House object contains an ArrayList of Storeys. Each Storey within the ArrayList contains a HashMap of Rooms. We are required to have a method that will return an array of all the Rooms within the house. Converting the HashMap to an array is easy enough, and I've done that, however I seem to be stuck on how to actually put all of the returned arrays from all of the Storeys together.

    There's little point in me posting my code for this, seeing as it is so jumbled.
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Read the API documentation of the Collection class and the ArrayList classes.
    It implements the addAll() method which you want to use.

    kind regards,

    Jos

    Comment

    Working...