Platform independency
I want to the exact meaning of platform independency because if we take a language like C programs can be run wihout installing C compiler. But JRE is compulsory for java..
I want to the exact meaning of platform independency because if we take a language like C programs can be run wihout installing C compiler. But JRE is compulsory for java..
If you take a C program compiled on a pc it is unlikely it will run on a Mac. It also doubtful you will get the same result if you run the same program on two different pc's.
However, if you compile a Java program on a pc, then there is a very high probably that it will run on any machine. As long as that machine has the corresponding JVM installed.
hi ragu.I would like to correct u that you dont need a compiler to run a program. C compiler is a must to run a program. Compilers vary.
True, but like flounder said: your (Windows-specific) exe won't run on Linux, or Mac(*).
(*)Wine, emulators and virtualisation notwithstanding
To run a JAR file containing Java classes, you won't need the Java compiler (javac).
You write and compile a Java program only once, and run it on all platforms with the same behavior and without any problems. This is called platform independence, which is not the case in a language like C or C++.
> To run a JAR file containing Java classes, you won't
> need the Java compiler (javac).
>
> You write and compile a Java program only once, and
> run it on all platforms with the same behavior and
> without any problems.
Not quite true. Platform independence in practice means that no re-compilation is needed, that the binaries will run on another OS that has a JVM. There are issues with code behaving slightly differently on different OS's though