I have a question what java List I should use when I want that result will be printed from that List the same way it was added to it?
Should I use ArrayList or LinkedList?
And could you tell me the same about java Sets and Maps?
I have a question what java List I should use when I want that result will be printed from that List the same way it was added to it?
Should I use ArrayList or LinkedList?
And could you tell me the same about java Sets and Maps?
If I got this right, you want a collection that preserves the insertion order. Lists always do that (no matter what implementation you choose).
I think that similar questions were asked already few times. Check out this: When to use LinkedList over ArrayList?
about other things like Map and Set you should find a Java book or tutorial and read a bit about them.