sort a list in java according to last name code example
Example: sort a list in java according to last name
//sort by a single field
Collections.sort(list, (o1,o2) -> o1.getfName().compareTo(o2.getfName()));
//sort by a single field
Collections.sort(list, (o1,o2) -> o1.getfName().compareTo(o2.getfName()));