I've created a class by using UML, and I have as objects Houses and Owners. I wanted an owner to have more than one houses, so I set navigable association and multiplicity 1...*.
So in the class an arraylist<house > Houses; has been created. How do I create this array in Main.java?
I know how to do this with 1 object, e.g.
but I don't know how to use it with an array.
Thanks in advance for the replies!
So in the class an arraylist<house > Houses; has been created. How do I create this array in Main.java?
I know how to do this with 1 object, e.g.
Code:
Owner X=new Owner();
House myhouse=new House();
X.setHouses(myhouse);
Thanks in advance for the replies!
Comment