June 10, 2022 Java core: interview question 2. Why Java is platform independent? Because the compiler generates byte codes instead of machine codes, and this byte codes can be run in any system with a JVM.