Static binding is a method of dispatching methods in a object oriented programming languages: it basically means that the implementation of a method for a specific object is chosen at compile time and not a runtime.
Questions tagged [static-binding]
57 questions
116
votes
9 answers
Static Vs. Dynamic Binding in Java
I'm currently doing an assignment for one of my classes, and in it, I have to give examples, using Java syntax, of static and dynamic binding.
I understand the basic concept, that static binding happens at compile time and dynamic binding happens at…

user2309750
- 1,403
- 4
- 14
- 11
105
votes
8 answers
What is the difference between Early and Late Binding?
What is the difference between early and late binding?

James A. Rosen
- 64,193
- 61
- 179
- 261
32
votes
6 answers
Static Binding and Dynamic Binding
I am really confused about dynamic binding and static binding. I have read that determining the type of an object at compile time is called static binding and determining it at runtime is called dynamic binding.
What happens in the code…

Abhinav
- 8,028
- 12
- 48
- 89
13
votes
3 answers
Shallow & Deep Binding - What would this program print?
I'm not sure how to do this...
function f1()
{
var x = 10;
function f2(fx)
{
var x;
x = 6;
fx();
};
function f3()
{
print x;
};
f2(f3);
};
For each of the following two binding…

Ricky
- 823
- 2
- 14
- 31
7
votes
1 answer
How can I avoid unexpected procedure name conflicts in service programs?
Using concepts learned from the famous IBM Red Paper on RPG Exception and Error Handling, I have written a service program QGPL/ERRFUNC to implement reusable error functions like Assert, Throw, ThrowMsg, Rethrow, and GetErrorMsg. I have been using…

Mike
- 1,274
- 10
- 24
7
votes
1 answer
Crystal C binding, simple hello world example.
I’m trying to figure out how c bindings in crystal work. For starters I’m wondering how I would include a simple hello world c function into crystal. Always good to start with the basics right? Here’s the function I’d like to include:
#include…

Jake
- 248
- 2
- 11
7
votes
1 answer
Why static binding works differently for class and function?
In python (tested on 2.7.6) all variables are
statically bound to a scope at compile time. This process is well
described in http://www.python.org/dev/peps/pep-0227/ and
http://docs.python.org/2.7/reference/executionmodel.html
It is explicitly…

user3022222
- 857
- 9
- 9
6
votes
2 answers
case: static binding? dynamic binding?
I know that overloading uses static binding and overriding uses dynamic binding.
But what if they are mixed?
According to this tutorial, to resolve method calls, static binding uses type information while dynamic binding uses actual Object…

du369
- 821
- 8
- 22
4
votes
3 answers
Difference between Static binding and Dynamic binding of Array
I've just read through all the search result about the same topic I'm asking right now in stackoverflow and it's not really answer my curiosity.But here's the thing.
The Question
1.)From what i know , static binding means it's set during compile…

caramel1995
- 2,968
- 10
- 44
- 57
4
votes
2 answers
Why and how can an object file of old code use new code that uses the generic programming paradigm even though templates are static binding?
This is an entirely different question than the one I asked before which is why I'm posting this.
I would like to define my topic to be a subjective question that inspires answers which explain "why" and "how". This is allowed according to the Help…

Wandering Fool
- 2,170
- 3
- 18
- 48
3
votes
3 answers
Java Overloaded AND Overridden Methods
In the following program, I have one single method in class A overloaded 3 times and then in subclass B, all 3 overloaded methods are overridden.
obj3 is an object with reference type A(superclass) and object type B(subclass) and it calls the method…

kenneth-rebello
- 914
- 1
- 7
- 13
3
votes
2 answers
Why is this a static binding instead of dynamic binding?
I'm still a little confused with regards to the difference between static and dynamic. From what I know dynamic uses object while static use type and that dynamic is resolved during runtime while static is during compile time. so shouldn't…

Challenger
- 251
- 2
- 13
3
votes
3 answers
What is the difference between compile time linking and run time linking?
I am currently reading a book and stuck at following code:
public class TestAnimals {
public static void main (String [] args ) {
Animal a = new Animal();
Animal b = new Horse();
a.eat(); // Runs the Animal version of…

Sandeep Gupta
- 43
- 5
3
votes
1 answer
PHP late static binding doesn't work correctly
While coding and using late static binding in PHP I found some strange behaviour. A child object created with static() in its parent class can access the private methods of its parent.
Here's an example:
class Attachment
{
public static function…

oncode
- 497
- 7
- 10
2
votes
2 answers
Non-virtual methods, static binding, and interface in C#
I understand that non-virtual methods are statically bound, which means, as far as I understand, that its known at compile-time itself as to which method will be invoked on which object. This decision is taken based on the static type of the…

Nawaz
- 353,942
- 115
- 666
- 851