Here's a list of strings.
ArrayList<String> nameList = new ArrayList<>(Arrays.asList("Mr.Green", "Mr.Yellow", "Mr.Red"));
Output each of its elements in the loop. Each element must be in a new line.
Here's a list of strings.
ArrayList<String> nameList = new ArrayList<>(Arrays.asList("Mr.Green", "Mr.Yellow", "Mr.Red"));
Output each of its elements in the loop. Each element must be in a new line.
Sample Input 1:
Sample Output 1:
Mr.Green
Mr.Yellow
Mr.RedCreate a free account to access the full topic