Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What does this mean???

 
Harvinder Singh
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does statically bound and dynamically bound means?
* Private method calls are statically bound ... a method will call
the private method in the class where it is defined .. even if the
calling method is inherited by a derived class and the derived
class defines a method with the same signature as the private method.
* Calls to public and protected methods in the same class are dynamically
bound ... even for constructors (and from private methods). This is
different to C++.
 
Marlene Miller
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Harwinder,
Binding is the process by which a name is associated with a property or feature that it names (a variable, a type, a code fragment).
Binding time is the time at which the binding takes place.
Early or static binding refers to binding performed at compile time (or link time or load time), whereas late or dynamic binding refers to binding performed at run time.
When a method is declared static, private or final, the method name is bound to a code fragment at compile-time. The compiler determines which code fragment will be executed for a particular method invocation.
Otherwise, the method name is bound to a code fragment at run-time. The virtual machine determines which code fragment to execute based on the type of the object and whether the method chosen by the compiler is overridden.
----
I don�t have a computer science degree, so I have to fill in the gaps by reading school stuff. Two very helpful books for me are
An Introduction to Object-Oriented Programming, Timothy Budd
Programming Language Pragmatics, Michael Scott
Marlene
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic