2. Which of the following statements is incorrect?
(1 Point)
Friend keyword can be used in the class to allow access to another class.
Friend keyword can be used for a function in the public section of a class.
Friend keyword can be used for a function in the private section of a class.
Friend keyword can be used on main().
Answers
Answered by
0
Answer:
option d is correct
Explanation:
Friend keyword can be used on main.
Answered by
1
Answer:
Friend keyword can be used on main().
Explanation:
- The member functions of a class can all be made friends at the same time if we make entire class a friend class. If in class Alpha the entire class Beta is proclaimed a Friend then all member function of Beta can access the private data of Alpha.
- Friend keyword can be used for a function in the public section as well as in the private section of a class. A friend function is not on the scope of a class of which it is a friend.
- This function is not invoked using the class object. So the declaration can placed anywhere in the class but can't be used in the main function as friend function act as a bridge between Two class.
Similar questions
Environmental Sciences,
27 days ago
Accountancy,
27 days ago
English,
27 days ago
India Languages,
1 month ago
English,
9 months ago
Hindi,
9 months ago