SunnyX
asked on
Core java. Create the class with method that do logic for all elements of collection.
Let there is pretty straightforward classes
I need to create some method that for example increase salary for all employees of the collection.
public class Employees {
String lastName;
Employees(String lastName, int salary) {
this.lastName = lastName;
this.salary = salary;
}
public String getLastName() {
return lastName;
}
}
public class EmployeesTest {
public static void main(String[] args) {
new Employees("Smith", 60000);
new Employees("Page", 75000);
new Employees("Musk", 88000);
new Employees("Dorsy",55000);
new Employees("Gates",54000);
}
}
I need to create some method that for example increase salary for all employees of the collection.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.