What is Access modifier?
Access modifier are the reserved keyword in object-oriented programming that control the visibility and scope of the class method and variables. They are core tools used to enforce encapsulation (hiding internal data and state) and abstraction (exposing only necessary functionality).
Public(public) ---> Accessible any where in the application(all packages and classes).
private(private) ---> Accessible only within the class members.
Protected(protected)---> Accessible within the same class, same package, and by subclasses in different packages.
Default(no keyword) ---> If no access modifier is specified, this means only classes within the same package can access it.
What is POJO?
POJO stands for Plain Old Java Object. It is an ordinary Java object that is completely independent of any specific framework, third-party library, or complex enterprise architecture.
It was introduced by sun microsystems.
POJO are used to represent the entities of business logic,
public class EmployeeEntity{ private String name; private int id; private int salary; public EmpolyeeEntity(String name , int id , int salary){ this.name = name; this.id = id; this.salary = salary; public String getName(){ return name; } public void setName(String name ){ this.name = name; } public int getId(){ return id; } public void setId(int id){ this.id = id; } public int getSalary(){ return salary; } public void setSalary(int salary){ this.salary = salary; } } } - There are no restrictions on access modifiers. Fields can be private, protected, public, or default.
- A constructor is optional.
- It can contain business logic and represent entities directly in the application.

