About 54 results
Open links in new tab
  1. How to make a new List in Java - Stack Overflow

    May 13, 2009 · List<String> list = new ArrayList<>(); This is how to create a LinkedList in java, If you need to do frequent insertion/deletion of elements on the list, you should use LinkedList instead of …

  2. Java Generics: List, List<Object>, List<?> - Stack Overflow

    Jan 29, 2009 · List<String> L = new ArrayList<String>(); You should read that as "L is a kind of List that deals with String objects". When you start dealing with Factory classes, it is critical to deal with …

  3. Converting array to list in Java - Stack Overflow

    How do I convert an array to a list in Java? I used the Arrays.asList() but the behavior (and signature) somehow changed from Java SE 1.4.2 (docs now in archive) to 8 and most snippets I found on t...

  4. How to print out all the elements of a List in Java?

    Apr 16, 2012 · Just using 'list.toString ()' won't print the individual elements, unless it's a custom implementation of the List interface which overrides the normal behaviour (to print the class name …

  5. arrays - Working with a List of Lists in Java - Stack Overflow

    I'm trying to read a CSV file into a list of lists (of strings), pass it around for getting some data from a database, build a new list of lists of new data, then pass that list of lists so it can be

  6. collections - How can I turn a List of Lists into a List in Java 8 ...

    Aug 5, 2014 · Actions are performed in the order of iteration, if that order is specified. And a List 's Iterator returns items in sequential order. For the Consumer, this code passes in a method reference …

  7. java - Qual a diferença entre Arrays.asList e List.of? - Stack Overflow ...

    Oct 6, 2017 · List<String> listOf = List.of("maça", "laranja"); listOf.set(0, "abacaxi"); // Erro: java.lang.UnsupportedOperationException Porém, vale lembrar de um detalhe: a lista retornada por …

  8. java - Difference between List, List<?>, List<T>, List<E>, and List ...

    The notation List<?> means "a list of something (but I'm not saying what)". Since the code in test works for any kind of object in the list, this works as a formal method parameter. Using a type parameter …

  9. java - How to sort a List/ArrayList? - Stack Overflow

    Apr 27, 2013 · I have a List of Double objects in Java. I want to sort the ArrayList in descending order. Input ArrayList:

  10. ¿Cuál es la diferencia entre ArrayList y LinkedList en Java y cuándo ...

    May 16, 2025 · Estoy aprendiendo sobre las colecciones en Java y vi que tanto ArrayList como LinkedList implementan la interfaz List, pero no tengo claro cuándo es mejor usar una u otra. Por …