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() { extern int i; i=20; printf("%d",sizeof(i)); }
struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }
how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!
main() { char not; not=!2; printf("%d",not); }
main() { char *p; int *q; long *r; p=q=r=0; p++; q++; r++; printf("%p...%p...%p",p,q,r); }
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.
#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }
void main() { int i=5; printf("%d",i+++++i); }
main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
program to find the roots of a quadratic equation
14 Answers College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,
#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }