Which of the following statement is not True?
2025
Which of the following statement is not True?
Answer: C. The scope resolution operator (::) can be overloaded like normal operators — Correct answer: The scope resolution operator (::) can be overloaded like normal operators — this statement is not true. Why this is not true: The scope…
- A.
A data member of a class can be declared as static and is normally used to maintain values common to the entire class.
- B.
A friend function can be invoked like a normal function without the help of any object.
- C.
The scope resolution operator (::) can be overloaded like normal operators
- D.
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.
Attempted by 122 students.
Show answer & explanation
Correct answer: C
Correct answer: The scope resolution operator (::) can be overloaded like normal operators — this statement is not true.
Why this is not true:
The scope resolution operator (::) is a built-in language operator used for namespace and class scope resolution. C++ does not allow overloading of certain fundamental operators, including ::, because their behavior is intrinsic to language semantics.
Other examples of operators that cannot be overloaded include the member access operator (.), the pointer-to-member operator (.*), the conditional operator (?:), and sizeof. These are reserved by the language.
Brief confirmations of the other statements:
A data member declared static is shared by all instances of the class and is used to maintain values common to the class (for example, a class-level counter).
A friend function can be called like a normal (non-member) function without needing an object, but it is granted access to the class's private and protected members by the friend declaration.
Multiple inheritance can cause duplication of a common base class when it is inherited via multiple paths; declaring that common base as a virtual base class causes a single shared instance to be used, avoiding duplication.
Conclusion: The only incorrect statement is the one claiming the scope resolution operator can be overloaded; the other statements are correct for the reasons given above.
A video solution is available for this question — log in and enroll to watch it.