I'm currently writing a java socket server and i was wondering what will happen in the next situation:
mainClass create Lobby class and add it to an array in the mainClass.
the Lobby class create a Room class and add it to an array in the Lobby class.
the Room class hold a reference to the Lobby class.
the mainClass remove the Lobby instance from the array
the lobby hold reference to the room and the room hold reference to the lobby, will they ever be cleaned up by the gc?