-4
你好我正在用Java做一個聊天程序,但後來我想出了idee,我想做出命令。例如,服務器寫入「日期」,然後它將返回客戶端的時間和日期!Java套接字程序支持
在代碼我寫:while(!streamChat.equals("CLIENT - END"));
它將關閉流或套接字,但我不能做一個如果修改,以便它可以讀取至極指揮它是什麼,它應該做的plz幫助我。
這裏是我的代碼:
do{
try{
streamChat = (String) inputdata.readObject(); //Reading the object.. and storing it in a variable...
showMess("\n " + streamChat);
}catch(ClassNotFoundException classNotFoundException){
//catching the errors...
}
}while(!streamChat.equals("CLIENT - END")); //The ending
我現在不在哪裏把if語句... ^^ – Tor 2014-09-20 18:14:19