Question: UML diagram to Java code I am having a hard time with the room and door class to transform it from UML diagram to JAVA

UML diagram to Java code I am having a hard time with the room and door class to transform it from UML diagram to JAVA CODE. The human class and Thing class does not need to be coded but the room

class and door class needs to be coded. Here is what I have for world class so far, if you think it needs fixing, please fix it:

public class World{ private ArrayList rooms; //constructor public World(){ //arrayList for type Room rooms = new ArrayList(); } public void addRoom(Room room){ //add room object into arrayList room rooms.add(room); } public ArrayList getRooms(){ return room; } public String toString(){ /* *will show info on each room */ String info = ""; for(int i= 0; i

UML diagram to Java code I am having a hard time with

the room and door class to transform it from UML diagram toJAVA CODE. The human class and Thing class does not need tobe coded but the room class and door class needs to be

World - rooms: ArrayList + World0 +addRoom(room Room) +getRooms() ArrayList + toString(): String

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!