Implement functionality to sort a list of Employee objects in Java using the Collections API.
The sorting should be performed using Collections.sort() with a custom Comparator implementation (no Lambda), supporting:
Sorting Employee list by Name (alphabetically - ascending)
Sorting Employee list by Salary (ascending - numeric value)
This change is intended to demonstrate Java Collections sorting fundamentals and will be used as part of Java training materials, internal code samples, and interview preparation content.
Scope Includes:
Create Employee class with properties (name, id, salary)
Implement two separate comparator blocks
Comparator for Name sorting using String.compareTo()
Comparator for Salary sorting using Double.compare()
Display before and after results in console output
#javainterviewquestionsanswers #seleniumautomation #seleniuminterview #sdetaddaforqaautomation #frameworkdevelopment #collections #collectionsapi #javacollections #java #qalead #testarchitect #devops #qaarchitect #qa-training