Encapsulation in Java is the concept of bundling data (variables) and methods that operate on the data into a single unit, restricting direct access to some of the object’s components. It is achieved using access modifiers like private and public.
Selvam College of Technology (Autonomous)
Encapsulation in Java is the concept of bundling data (variables) and methods that operate on the data into a single unit, restricting direct access to some of the object’s components. It is achieved using access modifiers like private and public.