if (strings.get(j).length()>=maxLength) { maxLength = strings.get(j).length(); System.out.println(strings.get(j)); }