This post probably belongs in 'java in general beginner'.
Java is platform independent since the class is in byte code and the JVMs are implemented independently to read the same byte code in various operating systems. So you can compile a java program in windows and run it linux without the need for any specific change.
I would suggest the head first java book or the SCJP study guide to get you up to speed in java. Good luck
'platform independent' is also an overloaded term. it means different things to different people.
Generally, when referring to java, it means that the compiled code, the bytecode, can run on any platform that has a JVM. i can put the exact same .class file on two different machines, with different OS, and it will run (assuming the JVM exists).
You cannot do that with a language like "C/C++". You have to compile a version of your binary specifically for each OS.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors