• +91 9723535972
  • info@interviewmaterial.com

VB.Net Interview Questions and Answers

Question - 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 --> Accessible ONLY by
1.Derived classes
2.Within the same class
Friend --> Accessible ONLY by
1.Derived classes
2.Classes in the same assembly
3.Within the same class
Protected Friend --> Accessible ONLY by
1.Derived classes
2.Classes in the same assembly
3.Within the same class]

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners