Object Oriented Programming (oop) Concepts(Career Aptitude Test ) Questions and Answers

Question 1. A copy constructor is called
  1.    when an object is returned by value
  2.    when an object is passed by value as an argument
  3.    when compiler generates a temporary object
  4.    all the above
Explanation:-
Answer: Option D. -> all the above
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!

Question 2. Virtual keyword is used
  1.    to remove static linkages
  2.    to call function based on kind of object it is being called for
  3.    to call the methods that don't exist at compile time
  4.    all the above
Explanation:-
Answer: Option D. -> all the above
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!

Question 3. Why is user defined copy constructor required?
  1.    there is no implicit copy constructor in C++
  2.    when pointers are involved implicit copy constructor does not give correct result
  3.    both a and b
  4.    none
Explanation:-
Answer: Option B. -> when pointers are involved implicit copy constructor does not give correct result
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!

Question 4. Dynamic dispatch is a feature that
  1.    selects which polymorphic operation to call at run time
  2.    selects which polymorphic operation to call at compile time
  3.    Both a and b
  4.    None
Explanation:-
Answer: Option A. -> selects which polymorphic operation to call at run time
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!

Question 5. An Abstract class
  1.    allows normal method declaration within
  2.    can be instantiated
  3.    Must have abstract methods with implemetation within
  4.    none
Explanation:-
Answer: Option A. -> allows normal method declaration within
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!

Question 6. The keyword 'this' is used
  1.    As reference to current object
  2.    Explicit constructor invocation
  3.    In open recursion
  4.    All the above
Explanation:-
Answer: Option D. -> All the above
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!

Question 7. Encapsulation helps
  1.    information hiding
  2.    in providing low coupling
  3.    in providing high cohesion
  4.    All the above
Explanation:-
Answer: Option D. -> All the above
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!

Question 8. Function Templates can have
  1.    Explicit instantiation definition with template argument for all parameters
  2.    explicit instantiation of declaration with template argument for all parameters
  3.    Both a and b
  4.    None
Explanation:-
Answer: Option C. -> Both a and b
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!

Question 9. Function templates are considered equivalent when
  1.    Declared in same scope
  2.    Having same name
  3.    Having identical return type and parameter list
  4.    All of the above
Explanation:-
Answer: Option D. -> All of the above
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!

Question 10. Pure virtual function is used
  1.    to give meaning to derived class function
  2.    to give meaning to base class function
  3.    to initialize all functions
  4.    None
Explanation:-
Answer: Option B. -> to give meaning to base class function
NO EXPLANATION IS AVAILABLE FOR THIS QUESTION!