encapsulation in Java | what is encapsulation | example of encapsulation
Encapsulation is a concept of object oriented programming which define as a process of wrapping code and the data together into a single unit. Or we can say that “It is the process of binding data members (variables, properties) and member function (methods) into a single unit”In Java the basis of encapsulation is the class. When we design a class in Object Oriented Programming (OOPs) like Java, the first thing we should have in mind is encapsulate it. There are several benefits, given below: -
- Better Maintainability
- Achieve Data Hiding
No comments:
Post a Comment