
java--exception
文章平均质量分 77
laorer
...
展开
-
The import com.sun.tools cannot be resolved
It's in the lib directory of the JDK, not the JRE. You'll need the JDK if you're going to develop Java programs!需要设定 jdk 为 lib 目录,而不是 jre为 lib目录http://www.codeguru.com/forum/showthread.php?threadid=493354原创 2010-07-16 10:21:00 · 11453 阅读 · 0 评论 -
ThreadLocal 与 static 变量
<br /> <br />ThreadLocal是为解决多线程程序的并发问题而提出的,可以称之为线程局部变量。与一般的变量的区别在于,生命周期是在线程范围内的。<br />static变量是的生命周期与类的使用周期相同,即只要类存在,那么static变量也就存在。<br />那么一个 static 的 ThreadLocal会是什么样的呢?<br />看下面一个例子,<br /> <br /> <br />public class SequenceNumber { private static Th原创 2010-09-26 10:09:00 · 10677 阅读 · 4 评论