freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

java基礎教程第3版習題解答-資料下載頁

2025-03-24 04:56本頁面
  

【正文】 。 sun=new Thread(this)。 zhao=new Thread(this)。 (張小有)。 (孫大名)。 (趙中堂)。 seller=new TicketSeller()。 } public void run() { if(()==zhang) { (20)。 } else if(()==sun) { (10)。 } else if(()==zhao) { (5)。 } }}第14章習題1.URL對象調用InputStream openStream() 方法可以返回一個輸入流,該輸入流指向URL對象所包含的資源。通過該輸入流可以將服務器上的資源信息讀入到客戶端。2.端口號與IP地址的組合得出一個網(wǎng)絡套接字。客戶端的套接字和服務器端的套接字通過輸入、輸出流互相連接后進行通信。3.使用方法accept(),accept()會返回一個和客戶端Socket對象相連接的Socket對象。accept方法會堵塞線程的繼續(xù)執(zhí)行,直到接收到客戶的呼叫。4. 域名/IP5. (1)客戶端import .*。import .*。import .*。import .*。import .*。 public class Client{ public static void main(String args[]) { new ComputerClient()。 }}class ComputerClient extends Frame implements Runnable,ActionListener{ Button connection,send。 TextField inputText,showResult。 Socket socket=null。 DataInputStream in=null。 DataOutputStream out=null。 Thread thread。 ComputerClient() { socket=new Socket()。 setLayout(new FlowLayout())。 Box box=()。 connection=new Button(連接服務器)。 send=new Button(發(fā)送)。 (false)。 inputText=new TextField(12)。 showResult=new TextField(12)。 (connection)。 (new Label(輸入三角形三邊的長度,用逗號或空格分隔:))。 (inputText)。 (send)。 (new Label(收到的結果:))。 (showResult)。 (this)。 (this)。 thread=new Thread(this)。 add(box)。 setBounds(10,30,300,400)。 setVisible(true)。 validate()。 addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { (0)。 } })。 } public void actionPerformed(ActionEvent e) { if(()==connection) { try //請求和服務器建立套接字連接: { if(()) {} else { InetAddress address=()。 InetSocketAddress socketAddress=new InetSocketAddress(address,4331)。 (socketAddress)。 in =new DataInputStream(())。 out = new DataOutputStream(())。 (true)。 ()。 } } catch (IOException ee){} } if(()==send) { String s=()。 if(s!=null) { try { (s)。 } catch(IOException e1){} } } } public void run() { String s=null。 while(true) { try{ s=()。 (s)。 } catch(IOException e) { (與服務器已斷開)。 break。 } } }}(2)服務器端import .*。import .*。import .*。public class Server { public static void main(String args[]) { ServerSocket server=null。 Server_thread thread。 Socket you=null。 while(true) { try{ server=new ServerSocket(4331)。 } catch(IOException e1) { (正在監(jiān)聽)。 //ServerSocket對象不能重復創(chuàng)建 } try{ ( 等待客戶呼叫)。 you=()。 (客戶的地址:+())。 } catch (IOException e) { (正在等待客戶)。 } if(you!=null) { new Server_thread(you).start()。 //為每個客戶啟動一個專門的線程 } } }}class Server_thread extends Thread{ Socket socket。 DataOutputStream out=null。 DataInputStream in=null。 String s=null。 boolean quesion=false。 Server_thread(Socket t) { socket=t。 try { out=new DataOutputStream(())。 in=new DataInputStream(())。 } catch (IOException e) {} } public void run() { while(true) { double a[]=new double[3] 。 int i=0。 try{ s=()。//堵塞狀態(tài),除非讀取到信息 quesion=false。 StringTokenizer fenxi=new StringTokenizer(s, ,)。 while(()) { String temp=()。 try{ a[i]=(temp).doubleValue()。i++。 } catch(NumberFormatException e) { (請輸入數(shù)字字符)。 quesion=true。 } } if(quesion==false) { double p=(a[0]+a[1]+a[2])/。 ( +(p*(pa[0])*(pa[1])*(pa[2])))。 } } catch (IOException e) { (客戶離開)。 return。 } } } }歡迎您的光臨,!希望您提出您寶貴的意見,你的意見是我進步的動力。贈語; 如果我們做與不做都會有人笑,如果做不好與做得好還會有人笑,那么我們索性就做得更好,來給人笑吧! 現(xiàn)在你不玩命的學,以后命玩你。我不知道年少輕狂,我只知道勝者為王。不要做金錢、權利的奴隸;應學會做“金錢、權利”的主人。什么時候離光明最近?那就是你覺得黑暗太黑的時候。最值得欣賞的風景,是自己奮斗的足跡。壓力不是有人比你努力,而是那些比你牛幾倍的人依然比你努力。 參考
點擊復制文檔內容
研究報告相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1