作者LaPass (LaPass)
看板java
标题Re: [问题] 新手Thread (执行绪问题)
时间Fri Nov 23 13:12:20 2012
1F:→ PsMonkey:就跟你说查 source code 了... 也未必会有最後一个 11/23 09:27
2F:→ TWTRubiks:是直接google吗?还是说要去哪查? 11/23 12:21
http://www.oracle.com/technetwork/java/javase/downloads/index.html
有一项叫做
Java SE 6 JDK Source Code
点进去後左边那边就有
Source code
Mercurial (6, 7, 7u, 8)
Bundles (6, 7, 7u)
然後..... 开你习惯用的code管理工具搜索 "class Thread " <=注意空白
就可以把那个物件给找出来
/**
* Returns a string representation of this thread, including the
* thread's name, priority, and thread group.
*
* @return a string representation of this thread.
*/
public String toString() {
ThreadGroup group = getThreadGroup();
if (group != null) {
return "Thread[" + getName() + "," + getPriority() + "," +
group.getName() + "]";
} else {
return "Thread[" + getName() + "," + getPriority() + "," +
"" + "]";
}
}
如果有兴趣的话可以去翻来看看
里面还有JVM的code
但老实说,除非未来打算往JVM深入
或是打算用C写东西给JAVA native来native去的才会用到这些东西
否则,把查javadoc的能力点高一点还比较有用
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.59.16.65
3F:推 PsMonkey:==.=== 练习看 source code 害不死人的 11/23 13:37
4F:→ awert:只会看javadoc没用,读code 11/24 00:54
5F:→ LaPass:看code是姬本技能.... 11/24 01:06
6F:推 supercygnus:嘘ps猴子 11/24 21:14
7F:推 tgenie: 虽然是老文了 但有学到哪里看SOURCE CODE 感谢 11/03 21:11