Collections Day 3
Collections Day 3
• For ex:
• List<Emp> empList=new ArrayList<>();
Creating A Custom ArrayList
• How do we add objects in a custom ArrayList ?
Before sorting:
[31, 28, 31, 30]
After sorting:
[28, 30, 31, 31]
How To Sort Custom ArrayList ?
• But when we call the sort( ) method of Collections class
and pass it our Emp list then it will generate an error.