ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories >> Code-Snippets >> Programming-Code >> C-Code
 
 
 
Question
why java is platform independent?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
Answer
Java was designed to not only be cross-platform in source 
form like C, but also in compiled binary form. Since this 
is frankly impossible across processor architectures Java 
is compiled to an intermediate form called byte-code. A 
Java program never really executes natively on the host 
machine. Rather a special native program called the Java 
interpreter reads the byte code and executes the 
corresponding native machine instructions. Thus to port 
Java programs to a new platform all that is needed is to 
port the interpreter and some of the library routines. Even 
the compiler is written in Java. The byte codes are 
precisely defined, and remain the same on all platforms. 

The second important part of making Java cross-platform is 
the elimination of undefined or architecture dependent 
constructs. Integers are always four bytes long, and 
floating point variables follow the IEEE 754 standard for 
computer arithmetic exactly. You don't have to worry that 
the meaning of an integer is going to change if you move 
from a Pentium to a PowerPC. In Java everything is 
guaranteed.
 
0
Dinesh Haridoss
 
View All Answers
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com