1.同一文件夹下的my为什么就可以通过编译,Threadtest.java不行?
2.为什么编译提示“仅当显式请求注释处理时才接受类名称"ThreadTest"?
- class Test extends Thread
- {
- Test(name)
- {
- super(name);
- }
- public void run()
- {
- for(int x = 0;x<60;x++)
- System.out.println("Thread.currentThread().getName()"+"...run..."+x);
- }
- }
- class ThreadTest
- {
- public static void main(String[] args)
- {
- Thread t1 =new THread("one+++");
- Thread t2 =new THread("two---");
- t1.start();
- t2.start();
- for(int i = 0;x<170;x++)
- System.out.println("Hello world");
- }
- }
复制代码
|
|