You can use the Collections.sort method with a custom Comparator:
import java.util.Collections;
import java.util.Comparator;
[...]
Collections.sort(empList, new Comparator() {
@Override public int compare(Employee x, Employee y) {
return Integer.compare(x.getAge(), y.getAge());
}
});
I used anonymous Comparator class, you can also write an ordinary Comparator class, see Sri Harsha Chilakapati answer.