Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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");
 
PREVIOUS NEXT
Tagged: #create #populate #list #line #java
ADD COMMENT
Topic
Name
9+7 =