javajvmjavacbytecode

5 questions on java


1) Is it true that javac.exe is sun's implementation of a java compiler,

2) and a java compiler is defined as something that translates java source code into java bytecode,

3) and a JVM is defined as something that accepts java bytecode as input and actually tells the machine to do things.

4) and there are many different kinds of JVM, in fact different operating systems Require different JVMs,

5) and the JVM which runs on windows 98 is different from the JVM which runs on windows 7?


Solution

  • I would take it that you're asking these questions to help you understand some of the basic concepts of JAVA, so let's not dig too deep and consider the many "exceptions" here.

    1) Sun's implementation of the compiler is usually called javac.exe, but other compilers may name their executables javac.exe as well (I think c means compiler).

    2) There's much more to it, but this in general is correct

    3) That's not completely incorrect. Different JVMs may have different implementations, but the idea of the JVM is to translate the (supposedly) universal bytecode to machine/OS-specific code that can be executed on that particular computer.

    4) Largely correct. Except we're defining "different OS" a little loosely. Some OSs share the same architecture, and they can use the same JVM. There can also be different JVM implementations for the same OS.

    5) That I believe is true.