Jump to content

Recommended Posts

Posted

[url="http://iforerunner.com/sunjava/posts/list/3066.page#3256"]http://iforerunner.com/sunjava/posts/list/3066.page#3256[/url]
[color=#000000][font=verdana, arial, helvetica, sans-serif][size=3]RL: [/size][/font][/color][url="http://en.wikipedia.org/wiki/Information_hiding"]http://en.wikipedia.org/wiki/Information_hiding[/url][color=#000000][font=verdana, arial, helvetica, sans-serif][size=3] [/size][/font][/color]
[color=#000000][font=verdana, arial, helvetica, sans-serif][size=3]In his book on object-oriented design, Grady Booch defined encapsulation as [/size][/font][/color][b]"the process of compartmentalizing the elements of an abstraction that constitute its structure and behavior; encapsulation serves to separate the contractual interface of an abstraction and its implementation."[/b][color=#000000][font=verdana, arial, helvetica, sans-serif][size=3][2] [/size][/font][/color]

[color=#000000][font=verdana, arial, helvetica, sans-serif][size=3]public private protected are the keywords [/size][/font][/color]

[url="http://www.javaworld.com/javaworld/jw-05-2001/jw-0518-encapsulation.html"]http://www.javaworld.com/javaworld/jw-05-2001/jw-0518-encapsulation.html[/url][color=#000000][font=verdana, arial, helvetica, sans-serif][size=3] [/size][/font][/color]
[color=#000000][font=verdana, arial, helvetica, sans-serif][size=3]Encapsulation refers to the bundling of data with the methods that operate on that data. [/size][/font][/color]
[color=#000000][font=verdana, arial, helvetica, sans-serif][size=3]Often that definition is misconstrued to mean that the data is somehow hidden. In Java, you can have encapsulated data that is not hidden at all. [/size][/font][/color]

[color=#000000][font=verdana, arial, helvetica, sans-serif][size=3]on the simple what I understood: [/size][/font][/color]
[b]A class can be said it is encapsulated
if it have various members( like public or protected or private)
It has member methods [/b]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...