As you know Java has become popular because of the byte code instructions. JVM can understand only the byte code instructions i.e.; every Java class will be converted into byte code instructions when it is compiled. In the other words, every Java file will generate a corresponding .class file after it is successfully compiled.

Since, byte code instructions are part of .class file, it's not that hard to extract the source code from a .class file.  This process is called as de-compilation. You can even write a program on your own to get the Java code. Or you can use any of the open source available decompilers to extract the source code.

I'm going to explain here with a open source Java decompiler. You can download this tool @

Just download and execute the exe file. You can see the below screenshot on your screen.

Java Decompiler

You can open a class file as shown in the below screenshot.

Java Decompiler - open file

It will immediately show you the Java source code. You can choose "Save source" if you want to save the sorce code.

Java Decompiler - view source
You can even open a JAR file and the tool will show you the source code for all the class files part of the JAR. You can then save all the source files of JAR with "Save all source codes" option.