Question
Download Solution PDFWhich of the following statement is not True?
Answer (Detailed Solution Below)
Option 3 : The scope resolution operator (::) can be overloaded like normal operators
Detailed Solution
Download Solution PDFThe correct answer is Option 3.
Key Points
- A data member of a class can be declared as static and is normally used to maintain values common to the entire class.
- A friend function can be invoked like a normal function without the help of any object.
- The scope resolution operator (::) cannot be overloaded like normal operators.
- Multiple inheritance may lead to duplication of inherited members from a "Grandparent" base class. This may be avoided by making the common base class a virtual base class.
Additional Information
- The scope resolution operator (::) is used to define the scope of a function or a variable in C++.
- While most operators can be overloaded in C++, the scope resolution operator (::) is one of the few exceptions that cannot be overloaded.
- This restriction helps in maintaining the clarity and unambiguous usage of the scope resolution operator.