Interview Questions  «Prev  Next»
  • Interview Questions
  • MDA Faq
  • RUP Faq1
  • RUP Faq2
  • UML Questions

  • Object Oriented Programming - Part 2

    1. Polymorphism is rendered possible by the fact that a pointer to a base class instance may also point to any subclass instance.
    2. A virtual function is a member function that you expect to be redefined in a derived class. When you call a virtual function through a pointer to a base class, the derived class's version of the function is executed. This is precisely the opposite behaviour of ordinary member functions.
    3. The first obvious use of a reference is to determine if the address of an object and not the object itself should be passed to an output function.
    4. A reference is an alternative name for an object.The primary use of references is for the specification of operations on user defined types.
    5. The terms a) method/member function b) instance variable/member data c) subclass/derived class d) parent class/base class can be used interchangeably.
    6. Prototype: A recent theory of classification where any object can be inherited from or cloned to serve as a prototype for newly created instances.
    7. Delegation refers to delegating the search for an attribute to a delegate and is therefore more of a pure message passing mechanism (as with dynamic scoping) than inheritance.
    8. Encapsulation is the process of hiding all of the details of an object that do not contribute to its essential characterisitcs.
    9. A pure virtual function requires no definition; you do not have to write the body of
      Employee:: compute pay 
      
    It is intended to be redefined in all derived classes. In the base class, the function serves no purpose except to provide a polymorphic interface for the derived classes. \hs {\sf [P134 MS] 20. Private members are only accessible from within a class.