|
on what criteria we will decide whether to use map or list?
|
|
|
|
|
It depends what you want to do with the information you are processing. The List [^] is just a simple list of values, whereas a Map [^] has keys to values for fast access.
|
|
|
|
|
i have one confusion that when we declare a list as below
List lt = new Arraylist();
Then in that case what value it can store i.e same type of value or it is capable of storing any type of variables or objects.
Jishnu
|
|
|
|
|
The List can store any type of object, but it does not make sense to store different types in the same list.
|
|
|
|
|
Many things you need to know,
1) IF you store just one object, use List, if you have two object key and value use Map.
2) List is ordered, your objects will be stored in the order on which they are inserted, Map is not ordered, unless you use sorted ones.
Source: See List vs Set vs Map
|
|
|
|
|
Why are you telling me this?
Use the best guess
|
|
|
|