You have written all of your code inside the of the entrypoint method (public static main) as Sergey pointed out. This is generally a really bad way of doing it, especially in a object oriented programming language (aka OOP) like Java. An OOP language is a language where you can sort your code into classes and functions.
The so called 'correct' way of doing this, would be to setup the code like this:
class Employee
public String name
public String department
public String designation
public float salary
public Employee (String name, String department, String designation , float salary)
this.name = name
this.department = department
this.designation = designation
this.salary = salary
public void sortingMethod1 ()
public void sortingMethod2 ()
public void sortingMethod3 ()
I don't see how you would implement abstract classes for this, since this will take care of the job. You'll also have you polish up the code since I have left some braces and terminators. Now from the main class, the assignment one, you can store an array of employees and change their values.
class Assignment55_000848913
ArrayList<employee> employees;
Scanner scan;
public static main (String[] args)
scan = new Scanner(System.in)
employees = new ArrayList<>()
do
sysout("Enter employee data using this format: name,department,designation,salary")
String data = scan.nextLine();
String[] tokens = data.split(",");
employees.add(new Employee(tokens[0], tokens[1], tokens[2], tokens[3]))
while (...)
</employee>