1. A copy constructor is called
a) When an object is defined and initialized with another object
b) When an object is passed by value
c) When a function returns an object
d) All of the above

2. Which of the following regarding constructor function is false?
a) Constructor functions don’t have return type, not even void
b) Constructors can’t be inherited
c) We can refer to their addresses
d) Constructors cannot be virtual

3. If new operator is used, then the constructor function is
a) Parameterized constructor
b) Copy constructor
c) Dynamic constructor
d) Default constructor

4. Which of the following statements regarding constructor is false?
a) A constructor may be defined static
b) Constructor can have default arguments
c) Member functions may be invoked from within a constructor
d) None of the above

5. The antonym of constructor is
a) Creator
b) Destructor
c) Destroyer
d) None of the above

6. Variable …………. of void type
a) May be declared
b) Cannot be declared
c) Can be initialized
d) None of the above

7. A destruction function
a) Takes no argument and has no return type not even void
b) Has name similar to that of class, preceded by tilde(~) symbol
c) Is used to destruct an object, constructed through constructor function
d) All of the above

8. Which of the following statements regarding destructor function is false?
a) Destructors do not accept any arguments, nor do they return any values
b) Destructors can be inherited
c) Member functions may be called from within a destructor
d) Destructor functions are called automatically when an object is destroyed

9. Function overloading
a) Involves several function definitions under one name, but different argument types
b) Implements polymorphism
c) Reduces the number of comparison in a program, hence increases the execution speed of a program
d) All of the above

10. The signature of function is
a) The number & type of arguments
b) The return type of a function
c) The class definition
d) None of the above

11. Overloading of constructor function
a) is similar to function overloading
b) different from an overloaded function as it can’t return a value
c) not permitted in C++
d) none of the above

12. The binding of a function call at runtime is
a) Static binding
b) Early binding
c) Late binding
d) Runtime binding

13. The process of giving special meaning to an operator is
a) Operator overloading
b) Operator mechanism
c) Operator definition
d) None of the above

14. The function used to define the task assigned to an operator is
a) Virtual function
b) Operator function
c) Static function
d) None of the above

15. The following operators can not be overloaded
a) Unary operator
b) Binary operator
c) Ternary operator
d) None of the above

16. Which of the following statements regarding operator overloading is not true?
a) New operators cannot be created while overloading
b) The semantics of an operator cannot be changed while overloading
c) Subscript operator([]) can be overloaded
d) None of the above

17. Which of the following statements can be overloaded?
a) Size of operator
b) Scope resolution operator (::)
c) Class member access operator (->)
d) Pointer to member operator

18. Operator functions
a) Can return a value
b) Cannot return a value
c) May return values of limited data types
d) None of the above

19. While overloading, a unary operator
a) Takes no arguments
b) Takes one argument
c) Takes two arguments
d) None of the above

20. While overloading, a binary operator
a) takes no argument
b) takes one argument
c) takes two arguments
d) none of the above

21. Which of the following operators cannot be overloaded?
a) increment and decrement operator
b) function call operator, ()
c) subscript operator, []
d) none of the above

22. When an arithmetic assignment operator is overloaded, the result
a) goes in the object to the left of the operator
b) goes in the object to the right of the operator
c) goes in the object of which the operator is a member
d) none of the above

23. The function that overloads as operator, precedes with the keyword
a) function
b) operator
c) virtual
d) static

24. The symbol **
a) can be overloaded
b) cannot be overloaded as it is not a C++ operator
c) cannot be overloaded, as on overloading its meaning shall be changed
d) none of the above

25. The stream insertion and extraction operators should be overloaded as
a) friend functions
b) member function
c) non member functions
d) none of the above
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: