So I've had a bet with an acquaintance. It's about what needs more space in developing with Java.
ArrayList<Player>
In coding with the Bukkit (Minecraft) API, a player includes a location, an inventory, a health bar, a foodlevel, an xplevel and much more. A string though, is only just a compilation of characters. That's why I think that an
ArrayList<String>
would be much more pleasant than an ArrayList with players, if you just need the player's name.
My acquaintance told me about object reference, and meant that it'd be exactly the same thing since I get the player's name by doing
player.getName();
and because of "object reference" stuff, no more space or processing power would be occupied.
Which thesis is true?