單項(xiàng)選擇題

在J2EE中,為了使得在客戶(hù)端可以接收用戶(hù)在控制臺(tái)上的鍵盤(pán)輸入,且把鍵盤(pán)輸入發(fā)送到服務(wù)器,同時(shí)還要接收服務(wù)器給客戶(hù)端的反饋,需要構(gòu)造三個(gè)用于輸入輸出的對(duì)象變量,以下代碼符合要求的是()。其中clientSocket是一個(gè)Socket類(lèi)的對(duì)象。     

A.BufferedRead br1 = System.in; BufferedRead br2 = new BufferedReader(clientSocket.getInputStream())); PrintStream ps = new PrintStream(clientSocket.getOutputStream());
B.BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));BufferedReader br2 = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));PrintStream ps = new PrintStream(clientSocket.getOutputStream());
C. BufferedRead br1 = new InputStreamReader(System.in); BufferedReader br2 = newInputStreamReader(clientSocket.getInputStream()); PrintStream ps = new PrintStream(clientSocket.getOutputStream());
D. BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));BufferedReader br2 = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); PrintStream ps = clientSocket.getOutputStream();

微信掃碼免費(fèi)搜題