• Post Reply Bookmark Topic Watch Topic
  • New Topic

Encapsulation in java  RSS feed

 
ksjpr singh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By encapsulation in object-oriented modelling we mean
a) encapuslating data and programs
b) hiding attributes of an object from users
c) hiding operations on object from users
d) hiding implementation details of methods from users of objects


Please give me exact answer of this question, i am confused with all options.
I need explanation of all above options.
if Yes then why ?
if No then why ?


Freshers please keep away from my post.....
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why should we give you the exact answers?
Do some reading, attempt the question and post if you have doubts explaining exactly where you have doubts.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ksjpr singh wrote:
Freshers please keep away from my post.....

For someone asking help, this is coming off as rude. You might want to reconsider this.

Also, please check your Purple Mooseages for an important administrative matter
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch :0

Please tell us where you found that quote. It is not at all well written; it says, “Encapsulation means encapsulation …”. Have you tried Wikipedia?
 
ksjpr singh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sorry to all,

That's not what I meant to say. My concern is to get exact answer not for me but also for all peoples those who will read this post.
I have been user of many Support Fourm sites where some freshers replies tend to confuse all peoples.
Again i apologize for my comments.



 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apologies accepted.
Where is that quote from?
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ksjpr singh wrote:Please give me exact answer of this question...

I fear you may have a long wait, because IMO there is no "exact" answer. Encapsulation means different things to different people, and languages vary in how they implement it and how strictly it is enforced.

However, the general meaning of the word - both in English and in Object-Orientation - is to "capture" or "contain"; and in Object-Oriented languages, it usually refers to the ability of a class to contain both fields (data) AND methods (behaviour) and present them as a named type.

Many of the things you list come under the general heading of "information hiding" which, depending on who you talk to, may or may not also come under the heading of "encapsulation". The Wikipedia page on the subject tends to support this view.

HIH

Winston
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ksjpr singh wrote:Please experts, what will be the answer in above options ?

As I've tried to tell you: it depends who you ask.

Purists would probably answer 'A' (except that "programs" is bad wording; objects have methods, not programs).

The rest come under the heading of "information hiding", so if you regard that as part of encapsulation, then ANY of your answers could be correct.

Winston
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!