For example, I would like to see the code of the class Line2D in the package java.awt.geom. How can I find it?
3 Answers
Go to jdk home folder. There will be a folder named src. In that you will get source code of all the inbuilt java classes.
C:\Program Files\Java\jdk<version>\src\java\awt\geom\Line2D.java
Probably you might be having src.zip folder. You can unzip it.
5 Comments
Captain Giraffe
The JRE does not contain src. Also the file extension on that seems suspicious.
Pippo
@RohitJain. You are right, I am a noob and I was wrong. :) I'll edit the title.
Pippo
@RohitJain. You anticipated me. :) However, I have to wait for a few minutes before accepting the answer.
Pippo
@RohitJain. No, it is the website which does not allow me to accept the answer immediately.
Pippo
@RohitJain. Done. Thanks again for the quick help!