Top "Collections" questions

Collections APIs provide developers with a set of classes and interfaces that make it easier to handle collections of objects.

Is there a no-duplicate List implementation out there?

I know about SortedSet, but in my case I need something that implements List, and not Set. So is there …

java list collections duplicates
Java Map equivalent in C#

I'm trying to hold a list of items in a collection with a key of my choice. In Java, I …

c# java generics collections
The easiest way to transform collection to array?

Suppose we have a Collection<Foo>. What is the best (shortest in LoC in current context) way to …

java arrays collections transformation
How to Serialize a list in java?

I would like to deep clone a List. for that we are having a method // apache commons method. This object …

java serialization collections apache-commons
Number of elements in a javascript object

Is there a way to get (from somewhere) the number of elements in a javascript object?? (i.e. constant-time complexity). …

javascript collections elements javascript-objects
ArrayList insertion and retrieval order

Suppose I insert 5 strings in an ArrayList. Will the order of insertion and retrieval from the ArrayList be the same?

java collections
Collections.sort with multiple fields

I have a list of "Report" objects with three fields (All String type)- ReportKey StudentNumber School I have a …

java sorting collections
How to iterate through LinkedHashMap with lists as values

I have following LinkedHashMap declaration. LinkedHashMap<String, ArrayList<String>> test1 my point is how can i …

java collections linkedhashmap
How to remove duplicates from a list?

I want to remove duplicates from a list but what I am doing is not working: List<Customer> …

java list collections duplicates
Why is a ConcurrentModificationException thrown and how to debug it

I am using a Collection (a HashMap used indirectly by the JPA, it so happens), but apparently randomly the code …

java exception collections concurrentmodification