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 |
print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
35 Answers Tata Elxsi, TCS, VI eTrans,
how can i search an element in an array
2 Answers CTS, Microsoft, ViPrak,
main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }
#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }
main() { signed int bit=512, mBit; { mBit = ~bit; bit = bit & ~bit ; printf("%d %d", bit, mBit); } } a. 0, 0 b. 0, 513 c. 512, 0 d. 0, -513
3 Answers HCL, Logical Computers,
void func1(int (*a)[10]) { printf("Ok it works"); } void func2(int a[][10]) { printf("Will this work?"); } main() { int a[10][10]; func1(a); func2(a); } a. Ok it works b. Will this work? c. Ok it worksWill this work? d. None of the above
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }
write a c program to print magic square of order n when n>3 and n is odd?
what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }
Program to Delete an element from a doubly linked list.
4 Answers College School Exams Tests, Infosys,
main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }