Thursday, April 25, 2013

Encapsulation

Why and how encapsulation is used?
  •  Encapsulation helps hide implementation behind an interface or API.
  • Encapuslated code has two features: 1) Instance variables are kept protected 2) Getter and Setter methods provide access to instance variables.
  • IS-A refers to inheritance or implementation
  • IS-A is expressed with the keyword extends
  • HAS-A means an instance of one class "has a" reference to an instance of another class.

No comments:

Post a Comment