Skip to content

Latest commit

 

History

History
85 lines (51 loc) · 1.17 KB

README.md

File metadata and controls

85 lines (51 loc) · 1.17 KB

Job_interview_exercises_Java_8

Job interview exercises with java 8 applying Api Stream, Java Collection Framework, Lambdas Expression, others.


Index 📜

See

Java Collection Framework




Project execution 🔝

See



String Methods

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

Code

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);
}
}

Console

[First string, Second string, Third string]