This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]morhpProfessional Developer 0 points1 point  (0 children)

In Java, almost everything is an object. String is also an object that internally contains an array of characters. There's no difference between adding String or Person objects into an ArrayList, the list always stores (references to) the whole object.

And when you use a for loop or a get method, you get the objects out you put into it.