Java, Encapsulation, Programming, Software Development, Technology.
employee.setName("Vikram Gupta"); /* employee.salary="20000"; 'salary' has private access in 'Employee', this can not be done. */ employee.setSalary(80000); System.out.println("name : " + employee.getName() + " empId : " + employee.getEmpId()+" salary : "+employee.getSalary()); } } Output: name :