why java is platform independent?

Answers were Sorted based on User's Feedback



why java is platform independent?..

Answer / gunjan

java is platform independent as JVM compiles source code to
its byte code which is then interpreted to object code.thus
any machine having a java compiler can execute that byte
code.this does not depends on the hardware or the OS of the
system

Is This Answer Correct ?    42 Yes 9 No

why java is platform independent?..

Answer / guest

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.

Is This Answer Correct ?    36 Yes 8 No

why java is platform independent?..

Answer / pawan mangal

java uses two process compiler and second one interpreter
compiler converted source code in to byte code and this byte code is universalize because it can be run by any jvm(java virtual machine).which is a interpreter
suppose u create a java programe in windows and u compile it then u have their byte code*(.class file)as discussion it can be run on any jvm means(linx )

Is This Answer Correct ?    9 Yes 1 No

why java is platform independent?..

Answer / coder

JVM does not compile Java source code to byte code. It is
the Java Compiler which does that. JVM runs on the target
machine which interprets the byte code and runs the program
on the target machine.

Java is not platform independent. Though you write the Java
source code, somebody else ( Sun Microsystems ) have done
the hardwork to implement JVM for the platform which is
going to run your program. "Java is Platform Independent"
is an illusion.

Is This Answer Correct ?    10 Yes 4 No

why java is platform independent?..

Answer / jagan_kumar

java compiler makes the class file which is not dependent
on the hardware or software of the system where we compiled.
Every system has its own JVM(System dependent) and will
takes .class file and produces the code which is executable
on that particular system itself.
So JVM makes the code portability.
hence JVM makes the JAVA as Platform Independent.
JAVA-JVM=NO USE of producing System indipendent code.

Is This Answer Correct ?    4 Yes 0 No

why java is platform independent?..

Answer / madhan

yes java is a platform independent. JVM(java virtual
machine) is used in java , that jvm can be converted source
code into byte code so java known as platform independent.

Is This Answer Correct ?    12 Yes 9 No

why java is platform independent?..

Answer / raj kumar.d

When compile a java code, the source code is converted into a byte code with the help of java interpreter. So java called platform independent.

Is This Answer Correct ?    2 Yes 0 No

why java is platform independent?..

Answer / hrindows@gmail.com

Java is called platform independent because of its byte codes which can run on any system irrespective of its underlying operating system.

Is This Answer Correct ?    0 Yes 0 No

why java is platform independent?..

Answer / asad raza

Bismillahir Rahmanir Rahim..
yes java is plateform independent, because its compiler
first convert the java code into byte-code(machine
language), which is the code that every plateform
understand, that's why it is called " plateform independent"

Is This Answer Correct ?    3 Yes 5 No

why java is platform independent?..

Answer / badrinath

java is platform independent b coz ,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 ?    0 Yes 2 No

Post New Answer

More C Code Interview Questions

plz tell me the solution.......... in c language program guess any one number from 1 to 50 and tell that number within 8 asking question in yes or no...............

2 Answers   Wipro,


main() { clrscr(); } clrscr();

2 Answers  


main() { int i=10; void pascal f(int,int,int); f(i++,i++,i++); printf(" %d",i); } void pascal f(integer :i,integer:j,integer :k) { write(i,j,k); }

1 Answers  


#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

2 Answers   CNSI,


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

0 Answers   TCS,






main() { float f=5,g=10; enum{i=10,j=20,k=50}; printf("%d\n",++k); printf("%f\n",f<<2); printf("%lf\n",f%g); printf("%lf\n",fmod(f,g)); }

1 Answers  


which function is used to clear the buffer stream on gcc? for example: I wrote following code on gcc #include<stdio.h> int main(void) { char ch; int a,b; printf("\nenter two numbers:\t"); scanf("%d%d",&a,&b); printf("enter number is %d and %d",a,b); printf("\nentercharacter:\t"); scanf("%c",&ch); printf("enter character is %c",ch); return 0; } in above progarm ch could not be scan. why?plz tell me solution.

2 Answers  


main() { printf("%x",-1<<4); }

3 Answers   HCL, Sokrati, Zoho,


main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }

9 Answers   CSC, GoDB Tech, IBM,


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

0 Answers  


main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }

4 Answers   CSC,


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.

6 Answers   Fusion Systems GmbH,


Categories