It\'s my understanding that the Java compiler produces \"byte code\", not \"object code\". First of all, is this correct?
Also, that\'s just what my book says, I was
C object code is in a form that only the OS on which it was compiled can interpret.
C code -> C compiler(e.g. gcc) -> object code -> os
The C compiler outputs object code for the OS that it was written for. If you want your C code to run on another machine, you have to recompile it.
C code compiled on Windows won't run on linux without recompiling.
Java code-> Java compiler(javac) -> byte code -> jvm
The Java compiler puts out byte code that runs on its JVM. All the idiosyncracies of the OS are pushed down into the JVM, hidden from the Java code. So as long as your OS has a JVM, you can run Java bytecode on it without recompiling. Java code compiled on Windows can run on any other OS with the same version of JVM.
Also refer difference between object code and byte code