Infosys Java Training Material Pdf Apr 2026

// Method 2: Implement Runnable (preferred) class MyRunnable implements Runnable public void run() /* task */

// Derived class public class PermanentEmployee extends Employee private double baseSalary; private double bonus;

| Interface | Implementation | Use Case | |-----------|----------------|-----------| | List | ArrayList, LinkedList | Ordered, duplicates allowed | | Set | HashSet, TreeSet | Unique elements | | Map | HashMap, TreeMap | Key-value pairs | | Queue | PriorityQueue, ArrayDeque | FIFO processing | Example – Group employees by department Map<String, List<Employee>> deptMap = new HashMap<>(); for (Employee emp : employeeList) deptMap.computeIfAbsent(emp.getDepartment(), k -> new ArrayList<>()).add(emp); Infosys Java Training Material Pdf

public PermanentEmployee(String empId, String name, double baseSalary, double bonus) super(empId, name); this.baseSalary = baseSalary; this.bonus = bonus;

public interface TaxCalculator double calculateTax(double income); // Method 2: Implement Runnable (preferred) class MyRunnable

// getters & setters

// for-each (preferred over index loops) for (String name : nameList) System.out.println(name); private double bonus

Four Pillars | Pillar | Java Implementation | |--------|---------------------| | Encapsulation | private fields + public getters/setters | | Inheritance | extends keyword | | Polymorphism | Method overloading & overriding | | Abstraction | abstract class / interface | Example: Encapsulation + Inheritance // Base class public abstract class Employee private String empId; private String name; public Employee(String empId, String name) this.empId = empId; this.name = name;