Javatpoint Logo
Javatpoint Logo

Encapsulation in PHP

Encapsulation in PHP
  • Encapsulation is a concept where we encapsulate all the data and member functions together to form an object.
  • Wrapping up data member and method together into a single unit is called Encapsulation.
  • Encapsulation also allows a class to change its internal implementation without hurting the overall functioning of the system.
  • Binding the data with the code that manipulates it.
  • It keeps the data and the code safe from external interference.

Example 1

Output:

Encapsulation in PHP
Next Topic




Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA