Sunday, February 16, 2014

Monday, February 23, 2009

What is Virtual table?

If a Class has Virtual Fucntion , then compiler will create a Virtual Table for that class which will contain the address of that function.

What is Virtual Pointer?

This is a virtual entity which contain the address of Virtual table of that class.For each class we have 1 virtual pointer.

What is Polymorphism?

  1. Polymorphism means "Many Shapes".
    Its of 2 types:
    Dynamic: Function overriding
    Static : Function overloading

What is Inheritance?

Inheritance is nothing but inheriting properties from its parents.Its of differnt types, public, private and protected.
Public Interitance:Public member variable/function: become publicProtected member variable/function: become privatePrivate member variable/function: will not inherit to child class
Private Inheritance:Public member variable/function: become privateProtected member variable/function: become privatePrivate member variable/function: will not inherit to child class
Protected Inheritance:Public member variable/function: become protectedProtected member variable/function: become privatePrivate member variable/function: will not inherit to child class

Advantages of C++ over C language?

Its true 'C' is more close to assembler but we will get alots of Object Oriented advantage with C++. C++ supports Data abstraction, Encapsulation, Inheritance and Polymorphism.It is easy to change C++ code as compare to C language.