Encapsulation is basically a process of binding together certain codes into one unit.


In Java the base of encapsulation is the class. A class defines the anatomy and behavior (knowledge and code) that will be aggregate by a set of objects. Each article of a accustomed class contains the anatomy and behavior authentic by the class, as if it were formed out by a cast in the appearance of the class.

Since the purpose of a class is to abbreviate complexity, there's mechanisms for hiding the complication of the accomplishing central the class. Each action or variable in a class may be apparent private or public. The accessible interface of a class represents everything that alfresco users of the class charge to know, or may know. The private methods & ability can alone be accessed by members that is a affiliate of the class. Therefore,any added member that is not a affiliate of the class cannot admission a clandestine action or variable.




0 comments to "ENCAPSULATION"

Post a Comment

Powered by Blogger.