why java is platform independent?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
C statement to copy a string without using loop and library function..
plz send me all data structure related programs
Finding a number multiplication of 8 with out using arithmetic operator
main() { char a[4]="HELL"; printf("%s",a); }
void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }
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)); }
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
Print an integer using only putchar. Try doing it without using extra storage.
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]); }
main() { 41printf("%p",main); }8
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }