I don't understand the requirements
package com.codegym.task.task07.task0708;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/*
Longest string
Initialize the list of strings.
2. Read 5 strings from the keyboard and add them to this list.
3. Using a loop, find the longest string in the list.
4. Display the string. If there is more than one, display each on a new line.
*/
public class Solution {
private static List<String> strings;
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(new InputStreamReader(System.in));
ArrayList<String> l = new ArrayList<>();
int largestStr = 0;
for (int i=0; i<5; i++){
l.add(sc.next());
if (l.get(i).length()> largestStr){largestStr = l.get(i).length();};
}
for (int i=0;i<l.size();i++){
if (largestStr == l.get(i).length()){
System.out.println(l.get(i));
}
}
}
}