62,628
社区成员
发帖
与我相关
我的任务
分享public class Client {
public static void main(String[] args) {
TestConnect tc1 = new TestConnect();
tc1.setIp("111");
Thread t1 = new Thread(tc1);
t1.run();
TestConnect tc2 = new TestConnect();
tc2.setIp("aaa");
Thread t2 = new Thread(tc2);
t2.run();
}
}
public class TestConnect implements Runnable{
private String ip;
public void setIp(String inputIp){
this.ip = inputIp;
}
@Override
public void run() {
for(int i=0;i<400;i++){
System.out.println(ip);
}
}
}
