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 bindingTest it NowOutput:dog is eating...
Next TopicDowncasting and instanceof operator |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India