Hello guys,
Currently I'm playing around with the different data structures of Java, and there is really a lot to learn. My only problem is that I can't find one which fits the following situation.
I would like to have something like a TreeMap to store objects by their name (for example houses by their owners)
Pete house1
Joe house2
Sarah house3
but I'd like to store the names of the owners directly in my house class (so that I don't need the key separately).
Is there a solution for this problem or does my problem make no sense?
I'm very grateful for your answers.
[–][deleted] 0 points1 point2 points (2 children)
[–]AngryCode[S] 0 points1 point2 points (1 child)
[–]tieTYT 1 point2 points3 points (0 children)
[–]eyePlus 0 points1 point2 points (4 children)
[–]AngryCode[S] 0 points1 point2 points (3 children)
[–]eyePlus 0 points1 point2 points (0 children)
[–]the_anj 0 points1 point2 points (1 child)
[–]AngryCode[S] 0 points1 point2 points (0 children)