Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. When class B is inherited from class A, what is the order in which the destructor of those classes are executed A. Class A

image text in transcribed

1. When class B is inherited from class A, what is the order in which the destructor of those classes are executed A. Class A first Class B next C. Class B's only as it is the child class B. Class B first Class A next D. Class A's only as it is the parent class 2. If a class Demo1 has a pure virtual function named f1, and class Demo2 inherits from Demo1, then, which of the following is correct A. It is optional for Class Demo2 to define the implementation of function f1 B. A user can define an object instance from class Demo1 C. It is optional for Class Demo1 to define the implementation of function f1 D. Class Demo2 cannot be inherited. 3. One of the following is correct A. Static member functions can access class member variables but non-static cannot B. You can call a static member function using object instance or using class name C. Non-static functions cannot access static class variables D. You can call a non-static member function using object instance or using class name 4. The default access level assigned to members of a class is A. Private C. Protected B. Public D. Needs to be assigned 5. For which type of class private and protected members of the class can be accessed from outside the same class in which they are declared A. No such class exist C. Static B. Friend D. Virtual 6. Having a member function defined as int f1 (int x, int y ) const means A. The function f1 cannot change x or y B. The function f1 cannot return a value that is based on calculations of class member variables C. The function f1 cannot change the class member variables D. The function f1 cannot change any value iniside, it only returns 7. The advantage of defining a member function as int f1(const A&x ) A. Guarantees that the passed object x is not changed within the function B. Allows quick parameter passing by passing the object value by reference C. No advantages D. A and B 8. Inside a function definition for a member function of an object with data element x, which of the following is equivalent to this- >X : A. ("this).x C. x B. this- >x D. Both A and C are correct

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions