The static method currentThread() from the type Thread should be accessed in a static way用静态方式存取 怎么操作?public static void main(String[] args){ Thread worker=new Thread(); String name = worker.currentThread().getName(); System.

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/14 02:49:47
The static method currentThread() from the type Thread should be accessed in a static way用静态方式存取 怎么操作?public static void main(String[] args){  Thread worker=new Thread();  String name = worker.currentThread().getName();  System.
xJA_\*A7y]avL$DT20"p5z-w..j9LHe &ETAT%`eUECPS9 2(b(Ъ);!{on5[8<*R:%Dft¦lcpV4bHan !AѤX}%2%مï_F\< 9-2uU^AO`7zNq#?Ye^8ޜ=xބWb5F9bqyukMe.;٣']79Wp"h?Mi}š

The static method currentThread() from the type Thread should be accessed in a static way用静态方式存取 怎么操作?public static void main(String[] args){ Thread worker=new Thread(); String name = worker.currentThread().getName(); System.
The static method currentThread() from the type Thread should be accessed in a static way
用静态方式存取 怎么操作?
public static void main(String[] args){
Thread worker=new Thread();
String name = worker.currentThread().getName();
System.out.println(name);
}
其中 worker.currentThread() 出现该警告.

The static method currentThread() from the type Thread should be accessed in a static way用静态方式存取 怎么操作?public static void main(String[] args){ Thread worker=new Thread(); String name = worker.currentThread().getName(); System.
它指的是currentThread()方法是个静态方法,用静态方式去访问,不是类的实例去调用.
你可以不管它,或者用Thread.currentThread().getName();