C++ MCQs - Classes & Objects
31. How to access the object in the class?
A. Ternary operator
B. Scope resolution operator
C. Direct member access operator
D. None of the above
View Answer
Ans : C
Explanation: Objects in the method can be accessed using direct member access operator which is (.).
32. When struct is used instead of the keyword class means, what will happen in the program?
A. Access is public by default
B. Access is private by default
C. Access is protected by default
D. None of the mentioned
View Answer
Ans : A
Explanation: Access is public by default will happen When struct is used instead of the keyword class.
33. Which of the following is not a member of class?
A. Static Function.
B. Friend Function
C. Const Function
D. Virtual Function
View Answer
Ans : B
Explanation: Friend function is not a member of class.
Also check :
Discussion