Question: Java programming Do the same question with Map Array Q3. Write a method named highest salary, that will get a List array of objects (named

Java programming Do the same question with Map Array

Java programming Do the same question with Map Array Q3. Write a

Q3. Write a method named "highest salary", that will get a List array of objects (named workerlist) of class Worker as an argument. Your method should find the worker who is getting the highest salary in that array, and should return the details of the worker as an object of class Worker to the back. Solution: public static Worker highest salaryl List workerlist) { Iterator itr = workerlist.Iterator(); float maxsalary=0; Worker worker maxsal worker while (itehasnext()) { worker = (Worker) itr.next(); if(worker.get wosalaryb>maxsalary) { maxsalary worker.get wosalaryD; maxsal worker = worker; } return maxsal worker }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!