English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

4 answers

Unlike the machine code for a specific processor, Java byte code is defined to be the same no matter what machine happens to be interpreting it. As a result, once you compile to the byte code, it should run on on any machine that has a byte code interpreter that conforms to the standard; thus you can run it anywhere.

Unfortunately reality eventually sets in and unless one wants to write code that only uses rudimentary input and output mechanisms, you end up having to choose a target environment in order to gain access to more functionality. So the reality is that while a Java compiler may produce target independent code, real apps aren't quite so portable.

2006-07-14 21:59:28 · answer #1 · answered by Anonymous · 0 0

when u compile java program they form a middle level byte code.
when u compile other programs they are converted directly as machine codes.

the byte codes are understood by a program called jvm or java virtual machine.
the machine codes are directly understood by operating systems.

now consider this. the are several jvms for each operating systems.but the byte code they are going to read is the same. and that is why compile once and run anywhere

2006-07-18 06:10:39 · answer #2 · answered by kanna 3 · 0 0

D'r padmaja this line i.e. java programs r compiled once and run any where actually means beacuse of the nature of java language.
coz to run or write a program in java u have to install jdk thats java development kit and jvm thats java virtual machine.(jvm is typically implemented in software on top of a "real" hardware platform and operating system, that runs compiled Java programs). this jvm is platform dependent.and java programs r compiled only once on a system having jvm.then a bytecode is formed after the compilation of a java program.this bytecode can be moved on different system to run it directly coz it is already in compiled form.for more information open the link:
http://www.javaworld.com/javaworld/jw-06-1996/jw-06-vm.html

2006-07-15 05:05:35 · answer #3 · answered by abhi 1 · 0 0

Ask the people at Starbucks.

2006-07-15 04:54:49 · answer #4 · answered by p_boxter03 4 · 0 0

fedest.com, questions and answers