Answer Posted / damodar narayan
Visibility
The visibility of a property or method can be defined by prefixing the declaration with the keywords public, protected or private. Class members declared public can be accessed everywhere. Members declared protected can be accessed only within the class itself and by inherited and parent classes. Members declared as private may only be accessed by the class that defines the member.
The policy is if you are not a member, you can’t get it. But there is a certain situation wherein you need to share your private or protected data with nonmembers. ‘Friends’ come here as a rescue.
A friend function is a non-member function that grants access to class’s private and protected members.
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Is php front end or back end?
What is mvc php?
What is php built on?
What are the different components used in php for formatting?
What is mysqli_real_escape_string?
What is the purpose of basename() function in PHP?
Is overloading possible in php?
What is session_register()?
What is a variable cost example?
How to get the ip address of the client?
Why php language is used?
How can php and javascript interact?
Swap two variables value without using third variable in php ?
what are interfaces and Abstart classes
Which function will suitably replace 'x' if the size of a file needs to be checked? $Size=x(filename);