Java gets its WORA nature from its bytecode. JAVA codes or programs are typed by the programmer in high-level user-friendly language and they are converted into a class file (also known as bytecode), an intermediate language before being converted into machine code. The point that is being emphasized upon here is that you can write JAVA code on any device, on any machine or platform and the class file that will be created remains the same all throughout.
This means that the same JAVA code can be run on any platform. So you don't have to write the code separately for a Linux device if you've written a certain JAVA code on a Windows device. In this way, WORA is achieved.
This is also one of the top java interview questions and to understand such concepts much more clearly.you can take up some basic java tutorials.