Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


samar
Java
1 Answer(s)      3 years and 11 months ago
Posted in : Java Interview Questions


What is Dynamic Binding ?

Advertisement
View Answers

October 29, 2010 at 12:35 PM


hi,

Dynamic Binding refers to the case where compiler is not able to resolve the call and the binding is done at runtime only. Let's try to understand this.

Dynamic binding is one of the distinguishing properties of Java. Instead of explaining the concept by usual definitions, let us try to figure out dynamic binding in Java practically.

Let us consider there is a java program named Practical.java which contains three classes in it.

  1. the main class named Practical

  2. a class named Multiple

  3. a class named Division.

So we try to compile the program with java compiler. Now, notice there are 3 .class files created in your current working directory. as

Practical.class

Multiple.class

Division.class

Why is this happening? We compiled a single java program but javac creates three .class files. The reason behind this is Dynamic Binding. The bytecodes(class files) are loaded and executed only at the run time and only when there is a necessity of the particular class. But in the case of c language hich does not support the dynamic binding concept, loads the entire code to execute no matter the particular piece of code is needed for the execution or not.

Also you cannot run the program without any one of the classes. For instance consider you deleted the add.class from the directory. And try to run the program and it will shows an error saying a supporting class is missing.

Thanks.



Related Tutorials/Questions & Answers:
java
java  diff bt core java and java
java
java  what is java
Advertisements
Java
Java   Whether Java is pure object oriented Language
java
java  different between java & core java
java
java  explain technologies are used in java now days and structure java
java
java   why iterator in java if we for loop
JAVA
JAVA  how the name came for java language as "JAVA
java
java  what is java reflection
java
java  is java open source
java
what is the size of array in java ?  what is the size of array in java ? what is the mean of finalize in java
java
java   in java does not pointers concept but what is nullpointers in java?   nullpointer is a runtime Exception
Java
Java  how to draw class diagrams in java
java
java  explain object oriented concept in java
Java
Java   Whether Java is Programming Language or it is SOftware
java
java  what are JAVA applications development tools
java
java  why to set classpath in java
java
java  give a simple example for inheritance in java
java
java  Does java allows multiline comments
java
java   What is ?static? keyword
java
java  write a java program using filenotfoundexception
java
java   difference between class and interface
java
java  why multiple inheritance is not possible in java
java
java  is java purely object oriented language
java
java  how use java method
java
java  send me java interview questions
java
java  write a program in java to acess the email
java
java  Write a java code to print "ABABBABCABABBA
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  give a simple example for inheritance in java
Advertisements
 

 

 

DMCA.com