Encapsulation:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVwNgbkO2G8gPwb26qu1V2xoiNRKGAktp1I5pTsUsRoyv8y2x9BYclYaT428kMx6jQrpJ4EhX3gpRtdjnZUYz59ZrC4sDFFF8NV2Ipv-He-s3liNnd4sepUk-D-BXbs9mrDZ1ph0MgpSc/s320/untitled.JPG)
- Encapsulation means binding data Members and methods into a single unit with data Security.
- Encapsulation is used for Security purpose.
- The Data members of a class will be private and methods of class will be public by using this we can access the functionality of a class but can not alter data.
- Polymorphism means one thing performs different actions depending on Situation.
- For example: Aperson performs different actions:
Somtime laughing
Sometime crying
Sometime angry - Method overloading is a way to achieve polymorphism.