C++ Programming - OOPS Concepts - Discussion
Discussion Forum : OOPS Concepts - General Questions (Q.No. 5)
5.
Which of the following concepts means determining at runtime what method to invoke?
Discussion:
37 comments Page 1 of 4.
Gunjan said:
6 years ago
Binding refers to linking of processor call to the code to be executed in response to the call.
(8)
Kandrasai said:
10 years ago
Binding means, linking of a procedural code to its functional call. During inheritance, when we are having the base and derived classes with same function name, at that time it may lead to the confusion of the compiler to link its exact procedural code. So we use the key word "virtual" to base class function.
So the compiler postpones the linking of procedural code for that one during the compile time. And binds its procedural code lately, which is called as "late or dynamic or run time binding".
So the compiler postpones the linking of procedural code for that one during the compile time. And binds its procedural code lately, which is called as "late or dynamic or run time binding".
(6)
Priti Rathi said:
1 decade ago
Dynamic binding is also called as a "Run time binding". It binds the function call to its body at a run time so we can say that, dynamic binding invokes the function call at run time.
(4)
Mohaaa said:
7 years ago
Dynamic typing concepts mean determining at runtime what method to invoke. Right?
(3)
Teju said:
9 years ago
Can anyone explain the difference between the data loading and data binding?
(3)
Madhu said:
10 years ago
@Guru,
Dynamic binding is a technique where function call could be linked to its code at run time. We can see it in inheritance, etc.
But dynamic loading is a mechanism undergone by the system where loading of libraries, functions and their data takes place.
Dynamic binding is a technique where function call could be linked to its code at run time. We can see it in inheritance, etc.
But dynamic loading is a mechanism undergone by the system where loading of libraries, functions and their data takes place.
(3)
Gagan said:
1 decade ago
Static Typing:
Static typed programming languages are those in which variables need not be defined before they're used. This implies that static typing has to do with the explicit declaration (or initialization) of variables before they're employed. Java is an example of a static typed language; C and C++ are also static typed languages. Note that in C (and C++ also), variables can be cast into other types, but they don't get converted; you just read them assuming they are another type.
Static typing does not imply that you have to declare all the variables first, before you use them; variables maybe be initialized anywhere, but developers have to do so before they use those variables anywhere. Consider the following example:
/* C code */
static int num, sum; // explicit declaration
num = 5; // now use the variables
sum = 10;
sum = sum + num;
The above code fragment is an example of how variable declaration in static typed languages generally appears. Note that in the above code, static has nothing to do with static typing; it has been used along with int only to initialize num and sum to zero.
Dynamic Typing:
Dynamic typed programming languages are those languages in which variables must necessarily be defined before they are used. This implies that dynamic typed languages do not require the explicit declaration of the variables before they're used. Python is an example of a dynamic typed programming language, and so is PHP. Consider the following example:
/* Python code */
num = 10 // directly using the variable
In the above code fragment, we have directly assigned the variable num the value 10 before initializing it. This is characteristic to dynamic typed programming languages.
Static typed programming languages are those in which variables need not be defined before they're used. This implies that static typing has to do with the explicit declaration (or initialization) of variables before they're employed. Java is an example of a static typed language; C and C++ are also static typed languages. Note that in C (and C++ also), variables can be cast into other types, but they don't get converted; you just read them assuming they are another type.
Static typing does not imply that you have to declare all the variables first, before you use them; variables maybe be initialized anywhere, but developers have to do so before they use those variables anywhere. Consider the following example:
/* C code */
static int num, sum; // explicit declaration
num = 5; // now use the variables
sum = 10;
sum = sum + num;
The above code fragment is an example of how variable declaration in static typed languages generally appears. Note that in the above code, static has nothing to do with static typing; it has been used along with int only to initialize num and sum to zero.
Dynamic Typing:
Dynamic typed programming languages are those languages in which variables must necessarily be defined before they are used. This implies that dynamic typed languages do not require the explicit declaration of the variables before they're used. Python is an example of a dynamic typed programming language, and so is PHP. Consider the following example:
/* Python code */
num = 10 // directly using the variable
In the above code fragment, we have directly assigned the variable num the value 10 before initializing it. This is characteristic to dynamic typed programming languages.
(2)
Myths said:
10 years ago
Can you say real time example for data hiding/encapsulation?
(1)
Neha said:
1 decade ago
What is dynamic typing?
(1)
Guru said:
1 decade ago
What is difference between dynamic binding and dynamic loading? Can you explain me easily or any real time example?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers