1. When a base class is privately inherited by derived class
a) the public members of the base class becomes the private members of the derived class
b) the private members are not inherited
c) the protected members of the base class becomes the private members of the derived class
d) All of the above

2. Only one copy of the class is inherited, when it is defined as
a) virtual
b) static
c) public
d) none of the above

3. A class that acts only as a base class and is not used to create objects is
a) parent class
b) super class
c) abstract class
d) none of the above

4. The version of a virtual function actually gets called during runtime is based solely up in the type of the object that is
a) being instantiated and processed by the function
b) in the derived class
c) being pointed to by a base class pointer
d) being passed to the function

5. In multiple inheritance, the base classes are constructed
a) in the order of declaration in the derived class
b) in the order of declaration in the program.
c) in the order of definition of a class
d) none of the above

6. When an object of a derived class is created
a) derived class constructor is called followed by base class constructor
b) base class constructor is called followed by derived class constructor
c) base class constructor is not called at all
d) none of the above

7. The derived class constructor
a) never passes any values to base class constructor
b) is responsible for passing the entire test of arguments needed by base class constructors
c) can pass arguments only to one base class constructor function
d) none of the above

8. A virtual base class
a) allows to inherit more than one copy of the base class members
b) strict the path of inheritance
c) is qualified as virtual in base class definition
d) none of the above

9. When a base class is inherited publicly
a) the private members of the base class are not accessible
b) the derived class can directly access the private members of the base class
c) the derived class can access the private members only through the member function of the base class
d) none of the above

10. When two or more classes are used within another class definition, it is
a) inheritance
b) aggregation
c) both (a) & (b)
d) none of the above

11. Composition is referred to as
a) “is a” relationship
b) “has a” relationship
c) both (a) & (b)
d) none of the above

12. Inheritance is referred to as
a) “is a” relationship
b) “has a” relationship
c) Both (a) & (b)
d) none of the above

13. An explicitly defined destructor function
a) may be virtual
b) may not be virtual
c) both (a) & (b)
d) None of the above

14. The copy operation by a simple assignment causes in some cases
a) no effect
b) hollow copy
c) copy exactly the same as original
d) creates new

15. Public data members can be accessed
a) only from the base class itself
b) both form the base class and from its derived class
c) from the class which is a friend of the base class
d) none of the above

16. A static automatic variable is used to
a) make a variable visible to several function
b) make a variable visible only to one function
c) converse memory when a function is not executing
d) retain a value when a function is not executing

17. The stacks data structure are based on
a) LIFO
b) FILO
c) FIFO
d) None of the above

18. Queues are based on
a) LIFO
b) FILO
c) FIFO
d) None of the above

19. & operator is
a) indirection operator
b) Logical AND
c) address operator
d) none of the above

20. int *ptr[10]; is
a) an array of 10 int pointers
b) a pointer of 10 int elements
c) an array of 10 elements returning an int value
d) none of the above

21. A structure that refers to itself is a
a) nested structure
b) recursive structure
c) self-referential structure
d) none of the above

22. With in …….scope class member may be referenced simply by their names
a) class’s
b) object’s
c) program
d) none of the above

23. To point to the address of any pointer variable cast the pointer to
a) char *
b) int *
c) void *
d) none of the above

24. Destructors are called
a) in the same order of constructor calls
b) in the reverse order of constructor calls
c) in any random order
d) none of the above

25. The advantage of declaring a virtual function as pure is
a) you can avoid making the class an abstract class
b) you force any derived class to define its own implementation
c) programs runs faster
d) early binding can be achieved
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: