I got it running but can someone please explain this to me thank you
package com.codegym.task.task07.task0708;
import java.util.Scanner;
import java.awt.List;
import java.util.ArrayList;
public class Solution {
private static ArrayList<String> strings;
public static void main(String[] args) throws Exception {
Scanner kb = new Scanner(System.in);
strings = new ArrayList<String>();
for (int i =0; i<5;i++) {
String s = kb.nextLine();
strings.add(s);
}
int longest = strings.get(0).length();
for(int j = 1;j < strings.size();j++) {
int temp = strings.get(j).length();
if(longest < temp)
longest = temp;
}
for(int k = 0;k < strings.size();k++) {
if(longest == strings.get(k).length())
System.out.println(strings.get(k));
}
}
}