Question
You need to write a program to create 2 interfaces in JAVA: Organize and Calculate. Organize interface has an abstract method, sort, accepting a String
You need to write a program to create 2 interfaces in JAVA: Organize and Calculate. Organize interface has an abstract method, sort, accepting a String array as parameter; and returning a String array as well. Calculate interface has an abstract method, calculate, accepting an integer array as parameter; and returning just an integer value. You also need to create 2 classes: Company A and Company B; both implementing Organize and Calculate interfaces. Both classes have attributes (all array type) as name, age, and salary for corresponding employees.
To accept all information, create a driver class and then using both interfaces and their methods find out the employee with highest salary from Company A and youngest employee from Company B. Also show: the sorted list of employees from Company A in ascending order based on their name, and: the sorted list of employees from Company B in descending order based on their salary.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started