This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman 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 Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Encapsulation" Watch "Encapsulation" New topic
Author

Encapsulation

Tarun Oohri
Ranch Hand

Joined: Feb 20, 2013
Posts: 189
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: 44048
    
  33
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: 189
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: 44048
    
  33
You're welcome
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Encapsulation
 
It's not a secret anymore!