Right click the word in the IDE, and select
Go to Declaration. Most IDEs will take you to the file, where that code is written. Such as, the following code,
public class Program {
public static void main(String[] args) {
System.out.println("Google it, bro!");
}
}
If you right click and select the declaration for
String
, it will work. But the same will not work for
void
word. The reason is that the keywords are predefined in the language library, and however the custom types (
String
is not built in type in Java), can be easily checked up against.
Warning just stop, because you don't need to read the source code Java to learn Java, But... if you really want to go ahead and read the code of Java JDK, go ahead and download the archives for the Java JDK,
Java SE - Downloads | Oracle Technology Network | Oracle[
^] (try luck here...), then navigate to the folder where the Java file would be.
java.lang.String would be located under
java/lang/String.java.
You should also look into OpenJDK to get the latest version of source code for Java, applied to open source standards and APIs.
OpenJDK[
^]