Top "Collections" questions

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

FIFO based Queue implementations?

I need a simple FIFO implemented queue for storing a bunch of ints (I don't mind much if it is …

java collections queue
Best way to create an empty map in Java

I need to create an empty map. if (fileParameters == null) fileParameters = (HashMap<String, String>) Collections.EMPTY_MAP; The …

java dictionary collections hashmap
How can I initialize an ArrayList with all zeroes in Java?

It looks like arraylist is not doing its job for presizing: // presizing ArrayList<Integer> list = new ArrayList<…

java collections
Difference between a Seq and a List in Scala

I've seen in many examples that sometimes a Seq is being used, while other times is the List... Is there …

list scala collections seq
How can I initialize a C# List in the same line I declare it. (IEnumerable string Collection Example)

I am writing my testcode and I do not want wo write: List<string> nameslist = new List<…

c# list collections initialization
How to shuffle an ArrayList

I need some help in writing a method that will shuffle the ArrayList. I can't figure out what to place …

java list collections
Print all key/value pairs in a Java ConcurrentHashMap

I am trying to simply print all key/value pair(s) in a ConcurrentHashMap. I found this code online that …

java collections hashmap concurrenthashmap
Notify ObservableCollection when Item changes

I found on this link ObservableCollection not noticing when Item in it changes (even with INotifyPropertyChanged) some techniques to notify …

c# wpf collections observablecollection inotifypropertychanged
How to sort Counter by value? - python

Other than doing list comprehensions of reversed list comprehension, is there a pythonic way to sort Counter by value? If …

python sorting collections counter
Efficiency of Java "Double Brace Initialization"?

In Hidden Features of Java the top answer mentions Double Brace Initialization, with a very enticing syntax: Set<String&…

java performance collections initialization