InterviewSolution
| 1. |
What Is The Difference Between Friend And Protected Friend? |
|
Answer» Protected variable will be accessed in INHERITED class, but instance variable of class CANT access protected variable.While friend variable will be accessed in inherited class as well as instance variable of class across the project.Where we NEED both FUNCTIONALITY we are using protected friend scope. Protected variable will be accessed in inherited class, but instance variable of class cant access protected variable.While friend variable will be accessed in inherited class as well as instance variable of class across the project.Where we need both functionality we are using protected friend scope. |
|