Q8: Which of the following is not true of a constructor and destructor of the sa
ID: 3585625 • Letter: Q
Question
Q8: Which of the following is not true of a constructor and destructor of the same class? a. They both have the same name aside from the tilde (-)character. b. They are both usually called once per object created c. They both are able to have default arguments d. Both are called automatically, even if they are not explicitly defined in the class. Q9: How can Class A with an instance of an object of class B can change the values of private data members of Class B: a. Only possible by calling private member functions. b. Possible using public functions and references c. Never possible. d. Only possible if the private variables are not declared inside the class. Q10: If the line: friend class A; appears in class B, and the line: friend elass B; appears in class C, then: a. Class A is a friend of class C. b. Class A can access private variables of class B c. Class C can call class A's private member functions. d. Class B can access class A's private variables. Q11: In a circularly linked list, we navigate through the list using: a. Head pointer b. Tail pointer c. Both Head and Tail pointers d. Cursor Q12: Which of the following is not a kind of inheritance in C++7 a. public. b. private. c. static d. protected. Q13: Which of the following is most likely a base class of the other three? a. automobile. b. convertible. c. minivan. d. sedan Q14:: Class templates: a. b. c. d. May include the statement templates typename Type> anywhere. Must put templatec typename Type > before the class definition. Must include templatec typename Type > inside the class definition. Have the option of including the optional statement template. Q15: the head pointer points to NULL, it is an indication that a. the list is full and cannot accept any new nodes. b. the list has been destroyed c. the list needs to be destroyed d. there are no nodes in the list e. None of the aboveExplanation / Answer
8-they both are able to have default arguments - this is wrong as destructors have no arguments.
9- possible with public functions and refrences as public functions of class B can access the private members of
the class and as the functions are public so it can be accessed outside the class.
10- class A can access private variables of class B.as class A is friend of class B so it can access all the private
members of the class.
11-Head pointer -
12-Static is not a kind of inheritance.
13-Automobile is the base class as others inherit the basic properties of the automobile class.
14-May include the statement template<typename Type> anywhere.
15-there are no nodes in the list .
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.