• Post Reply Bookmark Topic Watch Topic
  • New Topic

Encapsulation  RSS feed

 
Pawan Arora
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand why the line classes that share the same interface are always tightly encapsulated is false.

since in case of polymorphism if different classes implement the same interface, then they can access their own class method, instead of knowing about the implemention of different method of class of the same interface. which means strong encapsulation.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first thing to do is define what encapsulation means. Then you can see if you can punch holes in the statement, given the definition of encapsulation.

So what does encapsulation mean?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... are always tightly ...


Another point, to disprove a statement that says something is "always" a case, all you need is one counter example.

Henry
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!