Job interview exercises with java 8 applying Api Stream, Java Collection Framework, Lambdas Expression, others.
Project execution 🔝
See
Using ArrayList Method 🔝
Write a Java program to create a list of arrays, add some values (of type strings) and print the collection.
See solution
import java.util.*;
public class Random {
public static void main(String[] args) {
List<String> list = new ArrayList<String>();
list.add("First string");
list.add("Second string");
list.add("Third string");
System.out.println(list);
}
}
[First string, Second string, Third string]