var list1 = List.of(1, 2); var list2 = new ArrayList(List.of(3, 4)); var list3 = new ArrayList(); And follow best practices... Don't use raw types. Since Java 5, generics have been a part of the language - you should use them: List list = new ArrayList(); // Good, List of String List list = new ArrayList(); // Bad, don't do ...More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.