Static Binding and Dynamic BindingConnecting a method call to the method body is known as binding. There are two types of binding
Understanding TypeLet’s understand the type of instance. 1) variables have a typeEach 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 bindingWhen 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 bindingWhen type of the object is determined at run-time, it is known as dynamic binding. Example of dynamic bindingOutput:dog is eating...
|
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/263827.html