Answers for "create and populate list one line java"

0

create and populate list one line java

List<String> list = Arrays.asList("foo", "bar");

or in Java 9
  
List<String> list = List.of("foo", "bar", "baz");
Posted by: Guest on October-01-2021

Code answers related to "create and populate list one line java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language