首先我们要学会的是将JDK源码加载Eclipse中。
1.点“窗口”——>"首选项",选择左边的"Java"——>"已安装的JRE",然后选择我们安装的JRE,并单击它,然后选择右边的“编辑”。
![](http://static.oschina.net/uploads/img/201503/14203826_DZlk.png)
点“编辑”将出现如下的界面:
![](http://static.oschina.net/uploads/img/201503/14203827_4aeM.png)
![](http://static.oschina.net/uploads/img/201503/14203827_Iyb9.png)
2.跟踪阅读源码
![](http://static.oschina.net/uploads/img/201503/14203827_Ix90.png)
如上图,在我自己写的代码中包含了StringTokenizer类,我们要看它的具体定义,就只要按住“Ctrl”键,然后将鼠标放在该类上再单击就可以看到该类的具体实现了。
![](http://static.oschina.net/uploads/img/201503/14203828_1Axp.png)
© 著作权归作者所有