About 23,900,000 results
Open links in new tab
  1. Checking if a collection is empty in Java: which is the best method?

    The other advantage of using Apache commons-collections CollectionUtils.isEmpty (or CollectionUtils.isNotEmpty) is that your if condition has less branches, so it is easier to reach a …

  2. java - How to sort alphabetically while ignoring case sensitive ...

    Sep 19, 2011 · 4 Pass java.text.Collator.getInstance() to Collections.sort method ; it will sort Alphabetically while ignoring case sensitive.

  3. A Java collection of value pairs? (tuples?) - Stack Overflow

    Eclipse Collections If you're using pairs that contain primitives, Eclipse Collections provides some very efficient primitive pair classes that will avoid all the inefficient auto-boxing and auto …

  4. java - Sort objects in ArrayList by date? - Stack Overflow

    Every example I find is about doing this alphabetically, while I need my elements sorted by date. My ArrayList contains objects on which one of the datamembers is a DateTime object. On …

  5. How to use Comparator in Java to sort - Stack Overflow

    Again, to use Collections.sort, you need one of these to be true: The type must be Comparable (use the 1-arg sort) A Comparator for the type must be provided (use the 2-args sort) When to …

  6. Java Immutable Collections - Stack Overflow

    Unmodifiable collections are usually read-only views (wrappers) of other collections. You can't add to, remove from or clear them, but the underlying collection can change. Immutable …

  7. How do I join two lists in Java? - Stack Overflow

    Oct 10, 2008 · Avoid Apache Commons Collections. It’s not typesafe, there are no generics. Great if you use Java 1.4, but for Java 5 and above, I’d prefer Google Guava.

  8. What is a java collection? - Stack Overflow

    Usually an instance of java.util.Collection (although java.util.Map is officially also a part of the collections framework) Although the Collection interface can be implemented directly, usually …

  9. java collections - keyset() vs entrySet() in map - Stack Overflow

    java collections - keyset () vs entrySet () in map Asked 13 years, 10 months ago Modified 6 years, 10 months ago Viewed 122k times

  10. Java: Best way to iterate through a Collection (here ArrayList)

    Today I was happily coding away when I got to a piece of code I already used hundreds of times: Iterating through a Collection (here ArrayList) For some reason, I actually looked at the …