• Post Reply Bookmark Topic Watch Topic
  • New Topic

subclassing violates encapsulation , its true ?  RSS feed

 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how subclassing violates encapsulation ? is it true ,please give example.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a reason to think it does? Do you know what 'encapsulation' means?

We generally don't just answer homework questions (or any other question) if the person puts no effort into answering it themselves. At the very least tell us why you think it does or doesn't...
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes encapsulation means data hiding using access specifier private/public /protected.

i gone through this link over internet.

http://www.javapractices.com/topic/TopicAction.do?Id=72

 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then if you know what is means, how does(n't) it break encapsulation?
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prabhat Ranjan wrote:yes encapsulation means data hiding using access specifier private/public /protected.

i gone through this link over internet.

http://www.javapractices.com/topic/TopicAction.do?Id=72


So think in these lines- How subclassing can/cannot change the access level of the members?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!