Why Java is platform independent?
In Java, source code is converted into java byte code(intermediate code ) . Byte code is highly optimized form of instructions and which does not dependent
on any platform or operating system language. So java byte code can be converted into platform specific language at runtime by JVM interpreter. That's why java is platform independent just because of java byte code.
refer the same in below picture.