How java achieve platform independence?
With the help of .class file java achieve platform independence.
When we write java program the extension of the file must be .java after compiling that .java file JVM will generate one special file i.e. .class file which is also known as byte code. that byte code/.class file will helps us to achieve platform independency. With the help of JVM cause JVM is platform dependent and every system has different operating system like Window has windows OS, mac has mac OS, Linux has Linux OS. that .class file will run on every operating system because that bytecode same for very OS.