Classes & Objects

17.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

18.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

19.Which of the following is not a member of class?

A. Static Function.
B. Friend Function
C. Const Function
D. Virtual Function

View Answer

20.Constructor is executed when _____.

A. An object goes out of scope.
B. A class is declared
C. An object is created
D. An object is used

View Answer

21.How many ways of reusing are there in class hierarchy?

A. 1
B. 3
C. 4
D. 2

View Answer

22. Where does the object is created?

A. Class
B. Constructor
C. Destructors
D. Attributes

View Answer

23.Which of the following is a valid class declaration?

A. Class A { int x; };
B. Class B { }
C. Public class A { }
D. Object A { int x; };

View Answer

24.Which of the following is not correct (in C++) ?
i) Class templates and function templates are instantiated in the same way
ii) Class templates differ from function templates in the way they are initiated
iii) Class template is initiated by defining an object using the template argument
iv) Class templates are generally used for storage classes.

A. i
B. i & ii
C. ii ,iii, iv
D. iv

View Answer

Also check :


* You must be logged in to add comment.