0

A program in c can be run on any machine. What does machine independency actually mean in terms of JAVA?

according to what I read, a compiled Java program can be run on any machine which has Java virtual machine that interprets the bytecode. I'm lacking few information and knowledge technically regarding how C isn't machine independent. does it need a different compiler for different operating systems? please help me out!!

8th May 2017, 3:43 PM
Ravalanatha Mallya B
Ravalanatha Mallya B - avatar
1 Answer
+ 2
When the java file is compiled, it gives a .jar file which can be run on any machine with JVM installed. For the C/C++, when you compile your code in windows, it give you an executable file which can onlu be run on windows. If you want to make it run on Linux, you need to recompile it on a Linux machine.
8th May 2017, 3:47 PM
Toky R.
Toky R. - avatar