This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Encapsulation" Watch "Encapsulation" New topic
Author

Encapsulation

Tarun Oohri
Ranch Hand

Joined: Feb 20, 2013
Posts: 172
Hello Everyone
Well, i have just under gone an interview in which i was asked this question :

Que . Which class in java is purely encapsulated ?

I answered "Bean class"..was i right ? If not what is the right answer ?

Thanks!!!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37950
    
  22
No, that is not the right answer. The right answer is to spend 30″ explaining what encapsulation means, and then giving a concrete example. It might be a good idea to give a counter‑example, e.g. java.awt.Point. A single word is hardly ever the right answer in an interview.
Tarun Oohri
Ranch Hand

Joined: Feb 20, 2013
Posts: 172
Campbell Ritchie wrote:No, that is not the right answer. The right answer is to spend 30″ explaining what encapsulation means, and then giving a concrete example. It might be a good idea to give a counter‑example, e.g. java.awt.Point. A single word is hardly ever the right answer in an interview.


Thanks C. Ritchie
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37950
    
  22
You're welcome
 
Consider Paul's rocket mass heater.
 
subject: Encapsulation
 
Similar Threads
What is Encapsulation
Encapsulation ?
Encapsulation
Encapsulation
doubt on uCertify question