File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What does this mean??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What does this mean???" Watch "What does this mean???" New topic

What does this mean???

Harvinder Singh
Ranch Hand

Joined: Feb 14, 2003
Posts: 90
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++.

Hard work beats talent<br />when talent doesn't work hard.<p> - Tim Notke
Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
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
I agree. Here's the link:
subject: What does this mean???
It's not a secret anymore!