圣骑士伪t2出处:try(java)中的问题,急

来源:百度文库 编辑:高考问答 时间:2024/05/05 07:29:55
class MulServer extends Thread {
private Socket client;
String str=null;

MulServer(Socket c){
this.client=c;
}
public void run(){
try{
BufferedReader in=new BufferedReader(new InputStreamReader(client.getInputStream()));
PrintWriter out=new PrintWriter(client.getOutputStream());
out.println("欢迎哈!!!!");
out.flush();
str=in.readLine();????????
//client.close();
}catch(IOException ex){
}finally{

}
}

String getInputFromOther(){
return str;???????
}
为什么str返回原值不是str=in.readLine();的值呢?

有没有完整的程序?