Question:
y?java is a platform independent?
harini
2007-12-19 00:36:28 UTC
y?java is a platform independent?
Four answers:
sivaji j
2007-12-19 00:58:42 UTC
java is not just a programming language its a platform.

whenever you compile a java program(.java file) ,java compiler will produce an intermediate output called bytecode(.class file) ,which can run only on java virtual machine(a runtime environment) .

so any system that has JVM can run java program
HareRam
2007-12-21 12:30:09 UTC
Yes Java is Platform Independent. the Java platform is an exception to the general rule that an operating system is a software platform. The Java language provides a virtual machine, or a “virtual CPU” which runs all of the code that is written for the language. This enables the same executable binary to run on all systems which support the Java software, through the Java Virtual Machine. Java executables do not run directly on the operating system; that is, neither Windows nor Linux execute Java programs directly.



Because of this, however, Java is limited in that it does not directly support system-specific functionality. JNI can be used to access system specific functions, but then the code is likely no longer portable. Java programs can run on at least the Microsoft Windows, Mac OS X, Linux, and Solaris operating systems, and so the language is limited to functionality that exists on all these systems. This includes things such as computer networking, Internet sockets, but not necessarily raw hardware input/output.
Marty
2007-12-19 09:30:40 UTC
Basically it's platform independent because the jave runtime environment can be run on pretty much any platform. Any system that can run the runtime environment can excecute java applications.
Tarun S
2007-12-19 14:34:27 UTC
Well the magic lies in the BYTECODE(.class file)

this file is created after u compile the progrm ,u need JVM or also called interpreter to interpret d bytecode to o/p.dis bytecode can be used on any machine as long as u hav d JVM on dat machine!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...