i want to print the salaries in asending order the last function which is called arrange must do the job either than that the code is working i cant do it with (collections.sort();)
public static void main(String[] args) {
ArrayList<Employee>al=new ArrayList<>();
ArrayList<Employee>all=new ArrayList<>();
Add(al);
Avg(al);
Count(al,all);
Arrange(al);
}
static void Add(ArrayList<Employee> arr){
Scanner s=new Scanner(System.in);
for(int i=0;i<2;i++)
arr.add(new Employee(s.next(),s.next(),s.nextInt()));
}
static class Employee{
String name;
String department;
Integer salary;
Employee(String name,String department,Integer salary){
this.name=name;
this.department=department;
this.salary=salary;
}
}
static void Arrange(ArrayList<Employee> arr){
for(Employee a:arr)
System.out.println(a.salary);}
}