Abstraction
refers to the act of representing essential features without including the
background details or explanation.
This is achieved in java by
- Abstract Class and Interface
- Abstract Class and Interface
- Hiding information by access modifier only give access
to required
- Object - Nothing can be accessed by Object ref.
- Object - Nothing can be accessed by Object ref.
Encapsulation
means wrapping up of data and methods into a single unit (Class).
Encapsulation is part of abstraction. It protects
abstractions.
A real world example,
Consider you have setup a big building(say a company),
the details regarding materials used to built (glass, bricks), type of work,
manager of the company, number of floors, design of the building, cost of the
building etc. can be classified as ABSTRACTION.
Whereas, type of glass or bricks (grey one or red one)
used, who all work for which all departments n how they work, cost of each and
every element in the building etc. comes under data ENCAPSULATION.
No comments:
Post a Comment