Infosys Java Training Material Pdf Direct

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;

@Override public double calculateSalary() return baseSalary + bonus; Infosys Java Training Material Pdf

public PermanentEmployee(String empId, String name, double baseSalary, double bonus) super(empId, name); this.baseSalary = baseSalary; this.bonus = bonus; Four Pillars | Pillar | Java Implementation |

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

public abstract double calculateSalary();

List<Employee> list = new ArrayList<>(); list.sort(Comparator.comparing(Employee::getSalary).reversed()); 7. Multithreading & Concurrency Creating Threads // Method 1: Extend Thread class MyThread extends Thread public void run() /* task */

public interface TaxCalculator double calculateTax(double income);