why java is platform independent?

Answers were Sorted based on User's Feedback



why java is platform independent?..

Answer / dinesh haridoss

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.

Is This Answer Correct ?    4 Yes 7 No

why java is platform independent?..

Answer / asha

java have java virtual machine which make java plateform
independent..jvm convert input source code into bye code
which is run on any plateform..

Is This Answer Correct ?    9 Yes 13 No

why java is platform independent?..

Answer / suresh

java is platform independent because the virtual machine
include all operating system,so java is run on any platform

java compiler converted source code into byte code,then the
jvm to translate the byte code into machine code

Is This Answer Correct ?    3 Yes 7 No

Post New Answer

More C Code Interview Questions

void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }

3 Answers  


C statement to copy a string without using loop and library function..

2 Answers   Persistent, TCS,


plz send me all data structure related programs

2 Answers  


Finding a number multiplication of 8 with out using arithmetic operator

8 Answers   Eyeball, NetApp,


main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,


void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }

1 Answers  


main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }

1 Answers  


main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }

1 Answers  


Print an integer using only putchar. Try doing it without using extra storage.

2 Answers  


main() { char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]); }

1 Answers   DCE,


main() { 41printf("%p",main); }8

1 Answers  


main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }

1 Answers  


Categories