Home > Back-end >  [is] the new Thread (mt) said the structure of the Thread method is undefined
[is] the new Thread (mt) said the structure of the Thread method is undefined

Time:10-04

The class MyTread implements Runnable {

Public void the run () {
for (int i=0; i<10; I++) {
System. The out. Println (" threads "+ I + Thread. CurrentThread (). The getName ());
}
}
}

Public class Examples01 {
Public static void main (String [] args) {
MyThread mt1=new MyThread ();
Thread the t1=new Thread (mt1);//& lt; -- -- -- -- -- -- -- -- -- -- - error here that Thread constructor undefined
T1. Start ();
}
}

Met strange things, help you old buddy, another piece of code written yesterday also used the new Thread (mt1), perform today is no problem, today to write this paragraph is an error,,,

Eclipse said in The constructor Thread (MyThread) is undefined

CodePudding user response:

Directly to the new Thread () does not pass parameters have a problem, a and parameter error

CodePudding user response:

I know, the bag in the class with the same
  • Related