We are learning about methods in class, and I am having trouble especially with the concept of static vs. dynamic.

Wikipedia says this:

Methods can be bound to a class at compile time (static binding) or to an object at runtime (dynamic binding).

Can anyone describe what they mean here?

| improve this question | | | | |
  • Interpreted languages usually use dynamic binding; compiled ones usually use static binding. Lisp, Scheme, Python, Perl, Ruby, bash, dos scripting are interpreted and use dynamic binding; Java, C, C++ are compiled and use static binding. Does this help? Of course things are harder, as IronPython is compiled down to IL for instance. – Job Oct 2 '11 at 4:01
  • Can you explain more about what exactly you don't understand? What wasn't clear about Wikipedia's articles on dynamic binding and static binding? – user8 Oct 2 '11 at 4:06
  • Well I was moreso wondering what it means to "bind a method to a class" – Dark Templar Oct 8 '11 at 21:57

Here are a few links with examples:

Run time binding or compile time binding?

Overloading is compile-time binding

METHOD Overload Vs Overriding

C#, early and late binding

| improve this answer | | | | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.