public class Main {
public static List<String> list = new ArrayList();
public static void main(String[] args) {
List<Integer> l = new ArrayList<>();
l.add(222);
l.add(100);
l.add(45);
l.add(415);
l.add(311);
l.sort(null);
System.out.println(l.get(0));
}
}
without l.sort(null) returned 222
with l.sort(null) returned 45