You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.2 KiB

import java.util.Arrays;
import java.util.List;
public class Main {
public static void main(String[] args) {
Employee e1 = new Employee(1, "Alice", "alice@example.com", 5000);
Employee e2 = new Employee(2, "Bob", "bob@example.com", 7000);
Employee e3 = new Employee(3, "Carol", "carol@example.com", 3000);
System.out.println("e1 email valid: " + e1.validateEmail());
System.out.println("e1 salary valid: " + e1.validateSalary());
EmailService emailService = new EmailService();
emailService.sendHireEmail(e1);
emailService.sendSalaryAdjustmentEmail(e2);
emailService.sendTerminationEmail(e3);
List<Employee> employees = Arrays.asList(e1, e2, e3);
EmployeeSearch search = new EmployeeSearch();
List<Employee> filtered = search.findBySalaryRange(employees, 4000, 8000);
System.out.println("Employees with salary 4000-8000: " + filtered.size());
EmployeeStatistics stats = new EmployeeStatistics();
System.out.println("Age distribution: " + stats.getAgeDistribution());
System.out.println("Salary distribution by dept: " + stats.getSalaryDistributionByDept());
}
}