Saturday, 25 August 2012

OOP's Objective Questions & Answers

1. Which of the following is not the member of class?
   a) Static function
   b) Friend function
   c) Constant function
   d) Virtual function
Ans. Friend function.

2. Which of the following is an abstract data type?
   a) int
   b) double
   c) String
   d) Class
Ans. Class

3. Which of the following correctly describes overloading of functions?
   a) Virtual polymorphism
   b) Transient polymorphism
   c) Ad-hoc polymorphism
   d) Pseudo polymorphism
Ans. Ad-hoc polymorphism.

4. Which of the following approach is adapted by c++?
   a) Top-down
   b) Bottom-up
   c) Right-left
   d) Left-right
Ans. Bottom-up.

5) Dispatch mechanism is implemented using ...
   a) Inheritance
   b) Polymorphism
   c) Dynamic method dispatch
   d) Abstraction
Ans. Polymorphism.

6) Which of the following statements regarding inline functions are correct ?
   a) It speeds up the execution
   b) It slows down the execution
   c) It increases the code size
   d) Both A & C
Ans. Both A & C.

7. What is size of object of empty class?
   a) 0 byte
   b) 1 byte
   c) 4 bytes
   d) 8 bytes
Ans. 1 byte.

8. Deadly Diamond of Death problem occurs because of ...
   a) Multiple inheritance
   b) Multilevel inheritance
   c) Hybrid inheritance
   b) None
Ans. Hybrid inheritance.

9. When we create object, reference of object is stored on ...
   a) Heap
   b) Stack
   c) MainMemory
   d) None
Ans. Stack

10. Can we have static and constant function in class?
   a) Yes
   b) No
Ans. No

No comments:

Post a Comment