What is encapsulation in oop php?



What is encapsulation in oop php?..

Answer / gokilavani s

Encapsulation is fundamental concepts in object oriented programming
Encapsulation provides three main benifits
Data hiding
Code organization
Code reusability
Php using access modifiers public, protected, private control access to the modified and properties
Public- accessible from anywhere
Protected - accessible within class and subclass
Private - accessible only in the class itself

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

How can I reverse sort an array keeping the correlation between the index and value?

2 Answers   Rushmore Consultancy,


What the use of var_dump()?

0 Answers  


what is different between PHP and Asp.net?

1 Answers  


Difference among echo, print and printf.

1 Answers  


How do you execute a php script from the command line?

0 Answers  






How to get the directory name out of a file path name?

0 Answers  


i have saved the password in encrypted format in database. now i want how to retrive the password in decrypted format.

6 Answers  


What is cookies? How to create cookies in php?

0 Answers  


How to do single and multi line comment in php?

0 Answers  


What is difference between static and constant?

0 Answers  


/temp is a type of filesystem directory. State Whether True or False?

0 Answers  


How can you associate a variable with a session?

0 Answers  


Categories