AceTheInterview
Jobs in Pune | Work better in teams | Socialize with friends | Submit Q&A | Tell a friend
Search site for 

Top 100 Interview Questions & Answers in a convenient and easy to read book!

“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”

– Ravi, California

Read more comments...

Interview Questions And Answers RSS Feed

Answers »

  1. Submitted By: Sri — October 6, 2006
    +12 votes
      + -

    I guess this is about dynamic binding and static binding.

    Dynamic Binding :
    The address of the functions are determined at runtime rather than @ compile time. This is also known as “Late Binding”.

    Static Binding :
    The address of the functions are determined at compile time rather than @ run time. This is also known as “Early Binding”

  2. Submitted By: ramaseshan — October 6, 2006
    +0 votes
      + -

    Static binding in C++ is achieved through Operator overloading where as runtime binding is achieved through virtual functions.

    In static binding,the compiler decides which function to invoke during compile time itself.

  3. Submitted By: Mars — October 6, 2006
    +20 votes
      + -

    Compile Time Binding : In case of operator overloading and function overloading the name of the function is resolved during the compile time . Even if there are two or more functions with the same name the compiler mangles the name so that each function is uniquely identified . This has to be resolved at compile time and is known as compile-time binding or early binding.

    Run Time Binding : In case of polymorphism (virtual functions) if a base class pointer(or reference) is allocated a pointer(or reference) of derived class the actual function called is determined only during runtime through the virtual table entry . This is runtime binding or late binding

  4. Submitted By: Veerbhan — November 10, 2006
    +2 votes
      + -

    Binding means assigning value to object.
    Static binding: means value is assigned to object(functions in many cases) is assigned value(address of function that will be called) during compile time.

    Dynamic Binding: Here in case of function calls, Compiler does not knows which function(code) will be executed on a function call because it depends on object who is calling the function. If the value of object which is calling function depends on program logic, function call cant be binded to function code during compile time.
    Thanks.

  5. Submitted By: Nasimudeen.A — March 30, 2007
    +3 votes
      + -

    Static binding: it makes link at compile time. It is also called early binding. In compile time polymorphism the compiler can recognize that which function call belongs to which function definition. It can identify this by the type and number of arguments in the function call.
    So the compiler makes appropriate links at compile time.

    Dynamic Binding :links can de determined only at runtime. In runtime polymorphism (it uses virtual functions to achieve this) using pointer to the base class and this can point to any derived class object as well as the base class object. This pointer is assigned at runtime then only it know that which function will be executed. According to the object assigned it will call function of the class which the object belongs to.

  6. Submitted By: hrushikesh — June 9, 2007
    -3 votes
      + -

    in runtime polymorphism,what is done inside the program

  7. Submitted By: Raaz — March 7, 2008
    +1 votes
      + -

    In runtime polymorphism for ex: while using virtual functions,the compiler wont be having knowledge about which function the casted base pointer is pointing to so the address of the function is resolved at the run time through a particular table called virtual table(vtable which holds the address of each function which is virtual and a pointer to the function).

  8. Submitted By: star — April 26, 2008
    not yet rated
      + -

    STATIC BINDING:: is the linking of an object to its associated methods as compile time.

    DYNAMIC BINDING:: also termed late binding, will delay this linking until runtime.

  9. Leave an Answer/Comment

    To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
    Click to hear an audio file of the anti-spam word

Our Sponsors
Our Sponsors
Contact Us | FAQ | Sitemap | Terms of Use | Privacy Policy | Tell a Friend

Copyright © 1999-2006 Jeeve Technologies LLC. All rights reserved.