Oops Online Test Questions and Answers - 2

14. Which of the following statements is correct?

a. Base class pointer cannot point to derived class.
b. Derived class pointer cannot point to base class.
c. Pointer to derived class cannot be created.
d. Pointer to base class cannot be created.

Answer:b. Derived class pointer cannot point to base class.


16. Which of the following is a value provided in function declaration that is automatically assigned by the compiler if caller of the function doesn't provide a value for the argument with default value?

a. Call by value
b. Call by reference
c. Default arguments
d. Call by pointer

Answer:c. Default arguments


17. In Which of the following concepts the function calls are not resolved until runtime and they are not bound until runtime?

a. Data hiding
b. Dynamic Typing
c. Dynamic binding
d. Dynamic loading

Answer:c. Dynamic binding


18. Which of the following is a normal function but it can only called by using an object rather a normal function that can be called directly?

a. Member Variable
b. Member function
c. Class function
d. Classic function

Answer:b. Member function




19. How many instances of an abstract class can be created?

a. 0
b. 1
c. 2
d. 3

Answer:a. 0


20. Which of the following is not the member of class?

a. Static function
b. Friend function
c. Const function
d. Virtual function

Answer:b. Friend function


21. Which of the following can be friend?

a. Function
b. Class
c. Object  
d. a and b

Answer:d. a and b


22. Which of the following concepts of OOPS means exposing only necessary information to client?

a. Encapsulation
b. Abstraction
c. Data hiding
d. Data binding

Answer:c. Data hiding


23. Dynamic loading means adding new components to a program as it runs.

a. Yes
b. No

Answer:a. Yes


24. Why reference is not same as a pointer?

a. A reference can never be null.
b. A reference once established cannot be changed.
c. Reference doesn't need an explicit dereferencing mechanism.
d. All of the above.

Answer:d. All of the above.