class MultiThread 
{
public static void main(String[] args)
{
System.out.println(Thread.currentThread().getName());
}
}
编译时出现下面的问题:
C:\JavaBar\MultiThread.java:8: cannot access Thread
bad class file: .\Thread.java
file does not contain class Thread
Please remove or make sure it appears in the correct subdirectory of the classpath.
System.out.println(Thread.currentThread().getName());
                                   ^
1 error
要是我显示的导入Thread类(import java.lang.Thread;)则编译和运行都可以通过
请问这是什么原因????

解决方案 »

  1.   

    我运行也正常,结果是main,我用的jcreate,是不是编译器的原因
      

  2.   

    我用的是j2sdk-1_4_2-windows-i586.exe
    在sun公司的官方网址下载的
      

  3.   

    我使用eclipse编译也可以通过,就是在DOS下编译会发生错误
      

  4.   

    bad class file: .\Thread.java
    是不是你自己有个文件 “.\Thread.java”?