Is java a platform independent language? |
| |
|
|
|
New Coder Posts: 25 Topics: 14
|
|
|
January 24, 2009, 10:18:02 AM
|
|
We all know that java is called a platform independent language but I don't think that it is totally platform independent. By platform independent one means that there is nothing other then the platform itself that is required to run an application. Now to run a java program we definitely need interpreter on every machine. The only thing that we don't require is a compiler. Is it right to call java a platform independent language?
« Last Edit: May 21, 2011, 10:57:39 AM by Admin »
|
|
| |
|
|
|
Code Guru Gender:  Posts: 1399 Topics: 85
|
|
|
January 25, 2009, 10:49:46 AM
|
|
I think you might be missing the point of "platform independant" - it does not mean what you think it does. The whole idea is that the Java program is translated (or compiled) into byte code. This byte code is then run under the JRE, each platform having a JRE and each JRE understands the same byte code. The key here (and platform independance) is the fact that the programmer can write a program, compile it and the files they publish can run on ANY platform (Windows, Linux, MacOS).
Compare this with languages such as C, C++ etc - it is difficult (but possible) to write portable code, however the compiler produces machine code, which is platform dependant. So in order to allow users of different platforms to run your program you need to distribute the source code. Not so much of an issue if you are programming just for Wintel users, but more of a challenge when programming for all the different flavours of Linux (which is why LInux programs are often distributed in source form.)
|
|
| |
|
|
|
Regular Coder Posts: 50 Topics: 19
|
|
|
July 16, 2010, 09:16:51 PM
|
When you compile C-sources you get a block of processor commands (naturally, different processors have different commands) and operating system function calls (naturally, different systems have different functions to call). When you try to run that program on the different processor it will not understand commands and the program wouldn't run. When you try to run the program on the same processor, but different OS, the program will be unable to perform most of its tasks, so it will not run as well. When you compile Java source, you get a block of "pseudo-commands" (they are like commands for some specific "java" processor) and "platform" function calls (these functions are like system functions of some specific "java" OS). When you want to run the compiled Java program on some machine, you should have Java Virtual Machine installed on that computer. JVM is like an emulator, that programmatically emulates "java" processor and "java" OS. Without JVM java program wouldn't ever run. ============= Herman Miller| Herman Miller Chairs
|
|
| |
|
|
|
Code Guru Gender:  Posts: 1399 Topics: 85
|
|
|
August 01, 2010, 06:34:44 AM
|
When you want to run the compiled Java program on some machine, you should have Java Virtual Machine installed on that computer. JVM is like an emulator, that programmatically emulates "java" processor and "java" OS. Without JVM java program wouldn't ever run.
This was initially an argument against using Java as when you emulate often this results in a large performance hit. This has been greatly improved with technologies such as the hotspot compiler, which actually compile parts of the Java byte code at runtime such that performance is often as good as compiled code.
|
|
| |
|
|
|
New Poster Posts: 13 Topics: 1
|
|
|
October 31, 2010, 11:43:33 PM
|
|
yes it is a platform independent language write once and run anywhere
|
|
| |
|
|
|
New Poster Posts: 13 Topics: 1
|
|
|
October 31, 2010, 11:46:47 PM
|
|
yes it is a platform independent language write once and run anywhere
« Last Edit: March 09, 2011, 04:17:50 AM by Admin »
|
|
| |
|
|
|
Skilled Coder Posts: 125 Topics: 0
|
|
|
April 12, 2011, 11:58:58 PM
|
|
Yes, Defiantly JAVA is platform independent programming language. It converts the given code into byte code, Every operating system has its own byte code so the java is platform independent
|
|
| |
|
|
|
Regular Coder Posts: 91 Topics: 4
|
|
|
April 24, 2011, 06:40:21 AM
|
|
When Java Code is compiled a byte code is generated which is independent of the system. This byte code is fed to the JVM (Java Virtual Machine) which resides in the system. Since every system has its own JVM, it doesn't matter where you compile the source code. The byte code generated by the compiler can be interpreted by any JVM of any machine. Hence it is called Platform independent Language.
Java's byte codes are designed to be read and interpreted in exactly same manner on any computer hardware or operating system that supports Java Runtime Environment.
|
|
| |
|
|
|
Skilled Coder Real name: Janne
Location: california
Gender: 
Age: 26
Posts: 108 Topics: 1
|
|
|
May 03, 2011, 12:06:42 AM
|
|
java is 1-simple 2-secure 3-portable 4-object-oriented 5-robust 6-multithreaded 7-architecture neutral 8-dynamic 9-platforn independent
|
|
| |
|
|
|
New Poster Posts: 10 Topics: 0
|
|
|
May 03, 2011, 06:09:39 AM
|
|
It is platform independent because you write the code once and it runs anywhere (at least anywhere which has a jvm written for it).
|
|
| |
|
|
|
Professional Coder Gender:  Posts: 242 Topics: 3
|
|
|
August 15, 2011, 08:36:05 AM
|
|
Yes, it is a platform independent OOP language..
|
|
| |
|
|
|
Professional Coder Posts: 229 Topics: 7
|
|
|
August 20, 2011, 12:20:55 AM
|
|
Java is the platform independent language and it is the main key benefit of java.
|
|
| |
|
|
|
New Poster Posts: 10 Topics: 0
|
|
|
August 23, 2011, 11:44:49 PM
|
|
Yes java is the platform independent language because it is the language where we use both compiler and interpreter.
|
|
| |
|
|
|
Regular Coder Posts: 88 Topics: 10
|
|
|
August 27, 2011, 04:11:47 AM
|
|
Why do I need Java?
There are lots of applications and websites that won't work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!
|
|
| |
|
|
|
New Coder Posts: 41 Topics: 0
|
|
|
September 21, 2011, 06:23:45 AM
|
|
yes it is plate independent language
|
|
| |