The best way to learn and improve coding skills in any programming language is to look at code written by expert programmers. The Java Development Kit (JDK) comes with the source code of the complete Java Runtime Library; it is located in the src.zip archive under the JDK installation directory.
Obviously your main reference when using the Java library classes should be always the API documentation, which can be found online or downloaded separately from the JDK downloads website. Here is the URL for the Java 8 API:
However, it can be very instructive to take a look at the source code of some of the key classes in the library, such as those in the java.lang and java.util packages.
Using Eclipse to view the Java Runtime Library Source Code
First, make sure you have the JDK selected as the default installed JRE. To do this select from the Eclipse menu: Window → Preferences. The following dialog pops up:
Select Java → Installed JREs
If the JDK is not there, click [Add…] and follow the prompts to select your JDK installation directory. Then make this JRE default by selecting the checkbox next to it. Now click [Edit…]. The following dialog pops up:
Expand the rt.jar library (this is the runtime binary) and click on [Source Attachment…]
Browse to the external location of your src.zip and click [OK]. Apply and close all parent windows.
Now to view the source file of a library class, e.g. LinkedList, either select from the menu:
Navigate → Open Type or use the shortcut [CTRL]+[SHIFT]+[T]
Type the name of the class, or select it from the list. The source code will open in the Editor.