What do you get when you compile a java program?
The java interpreter or JVM (Java Virtual Machine) is not able
to execute the java source code for a program. The java source code
first needs to be compiled into bytecode that can be processed by
JVM.
Producing bytecode make the program platform independent as each
platform has its own JVM. It is also possible to directly write
bytecode, bypassing the need to compile, but that would be tedious
job and also not good for security purpose as the compiler checks
for various errors in a program.