If a java program named digit is compiled and executed in a windows pc ,an class code is generated same as object code in c..is the class code is generated via compiler then in windows there is no complier is installed .how is it generated..... please explain me ......
When you compile the "digit" java code, the compiler generates a java bytecode. This bytecode is platform independent and needs a java virtual machine to run or something that can interpret the bytecode.
In java, we have java virtual machines or simply JVM which interprets the bytecode generated by compiler and JVM is compatible with a lots of devices from handhelds, systems, consumer electronic gadgets etc and any system running a JVM can read and run the bytecode generated.
So java bytecode is termed as platform independent and can run in any system that has a JVM.