Question: how bytecode is generated in java?
Answer: JVM runs the bytecode, Java compiler generates it. However, applications can generate the bytecode while they run, but the generated bytecode is again executed by the JVM. JVM, depending on platform , convert the byte code to m/c code. More precisely, JIT (just-in-time) compiler inside JVM does this.