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 |
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256
main() { printf("%x",-1<<4); }
Printf can be implemented by using __________ list.
main() { char *p="GOOD"; char a[ ]="GOOD"; printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p)); printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); }
how can i search an element in an array
2 Answers CTS, Microsoft, ViPrak,
main() { char not; not=!2; printf("%d",not); }
how to delete an element in an array
void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u \n",gotit=--giveit); }
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above
#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
main() { static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); }