Hi all,
I have a class type of Object and inserting these values into List.
Eg: Employee class is having
int id, String name, String mail,
Employee e= new Employee(3,"Shankar","s@mail");
Employee e1= new Employee(2,"Sekahat","se@mail");
Employee e2= new Employee(37,"Sharat","sh@mail");
Employee e3= new Employee(1,"swaroop","s0@mail");
List<Employee> empList = new ArrayList<Employee>();
empList.add(e);
empList.add(e1);
empList.add(e2);
empList.add(e3);
Now I want to sort the list values based on id declared in the Employee class like below without using Collections.
1,"swaroop","s0@mail"
2,"Sekahat","se@mail"
3,"Shankar","s@mail"
37,"Sharat","sh@mail"
Can anyone please help on how to do this.
Thanks & Regards,
Suresh