Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

Describe the patterns of business communication.

Answered: 1 week ago

Question

3. Provide two explanations for the effects of mass media

Answered: 1 week ago