Connecting a method call to the method body is known as binding.
There are two types of binding
Understanding Type
Let's understand the type of instance.
1) variables have a type
Each variable has a type, it may be primitive and non-primitive.
Here data variable is a type of int.
2) References have a type3) Objects have a type
static binding
When type of the object is determined at compiled time(by the compiler), it is known as static binding.
If there is any private, final or static method in a class, there is static binding.
Example of static bindingDynamic binding
When type of the object is determined at run-time, it is known as dynamic binding.
Example of dynamic bindingOutput:dog is eating...
|
Sunday, 12 April 2015
Static Binding and Dynamic Binding
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment