Java is platform independent programming language. Here platform means an operating system. When we say platform independent it actually means that the software made with this programing language can run on any of the specified operating systems.

Once the software is made for one platform, it can run on multiple platforms that support the language. Java is supported on Windows, Linux, macOS, AIX and FreeBSD operating systems.

Java is a platform independent programming language
Benefits of being platform independent.

1. If certain software or language is platform independent then is reduces the cost of coding different software for users of different operating systems.

2. WORA is supported - Write Once Run Anywhere.

3. A large amount of users can be served with minimum investment in development.

4. Maintenance of software becomes easy and cost effective.

How Java attains platform independent ?

Java attains platform independent with the help of Bytecode. Here the below diagram will help you to understand this better.

Java code to byte code


From the above diagram you can understand that when we write a java code. This java code is saved with the extension (.java). This .java file is compiled to a .class file. This .class file can run on the JVM on any platform. 

This mechanism lets us to run a single java code on multiple platforms. The bytecode can run on any machine that can run JVM.