encapsulation means putting related items together?
<p>I was going through <a href="http://www.codeproject.com/KB/scripting/edujini_005_JavaScript_OO.aspx" rel="nofollow">an article about Object Oriented Programming</a> and it stated that encapsulation means putting related items together, but I don't understand how the article's representative example: UserProfile.js. Though this example is in JavaScript, I'm looking to understand these concepts in <em>Java</em>.</p>

<p>Can anyone explain me these two questions with a pseudo code:</p>

<ol>
<li>What is encapsulation?</li>
<li>Why do we need encapsulation with pseudo code?</li>
</ol>
