Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c plz Comparable { private String name; private String id: private String title double salary: param a Name * @param ald * @param aTitle @param

image text in transcribed
image text in transcribed
c plz
Comparable { private String name; private String id: private String title double salary: param a Name * @param ald * @param aTitle @param a Salary public Employee(String aName, String ald, String Title, double a Salary) { super: name = aName id=ald: title=aTitle: salary = aSalary: return public String getName() { return name; public String getid) { return id; public String getTitle return title: { public double getSalary) { return salary: public abstract void set Salary(double hours): @Override public int compareTo(Employee e) { return 0; class Salary Employee extends Employee public Salary Employee(String aName, String ald, String aTitle, double aSalary) { super(aName, ald, aTitle, aSalary): @Override public void setSalary(double h) { // for every additional hour 275 salaryh27; class HourlyEmployee extends Employee public Hourly Employee(String aName, String ald, String aTitle, double aSalary) super(Name, ald, aTitle, a Salary): @Override public void setSalary(double h) { for every hour it is 25 salary=h25; Note: Please comment below if you have concerns am here to help you If you like my answer please rate and help me it is very Imp for me Create an ArrayList of 3 employees, I Salary Employee and 2 Hourly Employee. Use Collections.sort function to sort those employees, on the basis of: [8 pts] 1. Use an anonymous class that sorts by name high to low. II. Use a lambda expression that sorts by name low to high. III. Use a lambda expression that sorts by title then by salary. IV. Print the sorted employees using foreach and lambda expression. Comparable { private String name; private String id: private String title double salary: param a Name * @param ald * @param aTitle @param a Salary public Employee(String aName, String ald, String Title, double a Salary) { super: name = aName id=ald: title=aTitle: salary = aSalary: return public String getName() { return name; public String getid) { return id; public String getTitle return title: { public double getSalary) { return salary: public abstract void set Salary(double hours): @Override public int compareTo(Employee e) { return 0; class Salary Employee extends Employee public Salary Employee(String aName, String ald, String aTitle, double aSalary) { super(aName, ald, aTitle, aSalary): @Override public void setSalary(double h) { // for every additional hour 275 salaryh27; class HourlyEmployee extends Employee public Hourly Employee(String aName, String ald, String aTitle, double aSalary) super(Name, ald, aTitle, a Salary): @Override public void setSalary(double h) { for every hour it is 25 salary=h25; Note: Please comment below if you have concerns am here to help you If you like my answer please rate and help me it is very Imp for me Create an ArrayList of 3 employees, I Salary Employee and 2 Hourly Employee. Use Collections.sort function to sort those employees, on the basis of: [8 pts] 1. Use an anonymous class that sorts by name high to low. II. Use a lambda expression that sorts by name low to high. III. Use a lambda expression that sorts by title then by salary. IV. Print the sorted employees using foreach and lambda expression

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions

Question

Describe the factors influencing of performance appraisal.

Answered: 1 week ago