This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Encapsulation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Encapsulation" Watch "Encapsulation" New topic


akshay dev

Joined: Nov 08, 2012
Posts: 19
Can anyone give me a link for encapsulation? I didnt understand it very well.
Kevin Florish
Ranch Hand

Joined: Jan 06, 2009
Posts: 179
This may help with a basic understanding of Encapsulation.

Java5 Tutorials | Java6 Tutorials | HTML/CSS Tutorials | JavaScript and jQuery Tutorials
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 1050
Encapsulation: an object "keeps" its attributes and values, which are not known to other objects.
Usually, use private for these attributes and use getter to get them.
Adriano Ribeiro

Joined: Nov 16, 2012
Posts: 7
Michael Lee Scott, Programming language pragmatics, Edition 2, Morgan Kaufmann, 2006, ISBN 0126339511, p. 481: "Encapsulation mechanisms enable the programmer to group data and the subroutines that operate on them together in one place, and to hide irrelevant details from the users of an abstraction."
Rahul mir
Ranch Hand

Joined: Oct 31, 2012
Posts: 38

Encapsulation refers to the bundling of data with the methods that operate on that data.
I agree. Here's the link:
subject: Encapsulation
It's not a secret anymore!