public class TestThread
{
public static void main(String[] args)
{
new MyThread();
new MyThread.start();
for(int i=0;i<100;i++)
{
System.out.println(Thread.currentThread().getName()+" "+i);
}
}
}
class MyThread extends Thread
{
public void run()
{
for (int i=0;i<100;i++)
{
System.out.println(Thread.currentThread().getName()+" "+i);
}
}
}程序的文件名为TestThread.java ;但错误提示Exception in thread "main" java.lang.NoClassDefFoundError: Testjava/java
Could not find the main class: Testjava.java. Program will exit.
求教!
public static void main(String[] args) {
MyThread t=new MyThread();
t.start();
for (int i = 0; i < 100; i++) {
System.out.println(Thread.currentThread().getName() + " " + i);
}
}
}class MyThread extends Thread {
public void run() {
for (int i = 0; i < 100; i++) {
System.out.println(Thread.currentThread().getName() + " " + i);
}
}
}
new MyThread.start();
这不行啊,,
new MyThread().start();