在進行多線程編程中
package threadtest
/**
*
* @author shi mingxiang
*/
public class ReturnThreadInfo extends Thread {
private String str;
public ReturnThreadInfo() {
this
}
public void run(){
this
}
public String getThreadInfo(){
return this
}
}
大家可以看到該類是一個線程類並含有一個初始值為
package threadtest
/**
*
* @author shi mingxiang
*/
public class Main{
public Main() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
ReturnThreadInfo returnThreadInfo = new ReturnThreadInfo();
returnThreadInfo
System
}
}
[
From:http://tw.wingwit.com/Article/program/Java/gj/201311/27710.html