About 272,000 results
Open links in new tab
  1. java - How does ArrayList work? - Stack Overflow

    Aug 12, 2010 · ArrayList uses an Array of Object to store the data internally. When you initialize an ArrayList, an array of size 10 (default capacity) is created and an element added to the …

  2. java - Create ArrayList from array - Stack Overflow

    Oct 1, 2008 · Note that the returned type for asList() is a List using a concrete ArrayList implementation, but it is NOT java.util.ArrayList. It's an inner type, which emulates an ArrayList …

  3. arraylist - How to use an array list in Java? - Stack Overflow

    References API: Java Collections Framework tutorial class ArrayList<E> implements List<E> interface List<E> E get(int index) Returns the element at the specified position in this list. Don't …

  4. Converting 'ArrayList<String> to 'String []' in Java - Stack Overflow

    Oct 28, 2010 · How might I convert an ArrayList<String> object to a String [] array in Java?

  5. Java ArrayList of ArrayList - Stack Overflow

    The instruction for new ArrayList(inner) creates a new ArrayList with the contents of inner inside of it - but doesn't use the same instance as inner. Thus, you'll retain the content, but not retain …

  6. java - How can I create an Array of ArrayLists? - Stack Overflow

    I am wanting to create an array of arraylist like below: ArrayList<Individual> [] group = new ArrayList<Individual> () [4]; But it's not compiling. How can I do this?

  7. java - What are the differences between ArrayList and Vector?

    Jun 6, 2010 · What are the differences between the two data structures ArrayList and Vector, and where should you use each of them?

  8. ArrayList of int array in java - Stack Overflow

    May 7, 2012 · System.out.println("Arraylist contains: " + arl.toString()); If you want to access the i element, where i is an index from 0 to the length of the array-1, you can do a :

  9. java - Storing and Retrieving ArrayList values from hashmap

    Oct 23, 2013 · @InsaneCoder Yes, it returns an ArrayList (of Integers). Whether or not you need a temporary ArrayList or not depends on what you want to do with it. You can call ee.getValue …

  10. When to use LinkedList over ArrayList in Java? - Stack Overflow

    List<String> names = new ArrayList<>(); I use the interface as the type name for portability, so that when I ask questions such as this, I can rework my code. When should LinkedList be …