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
can we swap two different string using php for example:-- before swapping:-- 1 string :-hello friend, 2 string :-my dear, after swapping that strings will be: 1.hello dear, 2.my friend.
Explain preg_Match and preg_replace?
What are the difference between echo and print?
How many open modes available when a file open in PHP?
How to track no of user logged in?
Describe which programming language does php parallel to?
How to access a Static Member of a Class in PHP?
Tell me how to find current date and time?
What are arguments in php?
How to delete an element from an array?
What is the difference between require and include in php?
What is factory pattern in php?
What is php glob?
How to convert a json string to an array in php?
What are the benefits of using php and mysql?