Phùng Quang Phi
New member
for (int i = 0; i < args.length; i++) {
try {
Socket socket = new Socket(args, 80);
System.out.print("Connected to " + socket.getInetAddress());
System.out.print(" on port " + socket.getPort());
System.out.print(" from port " + socket.getLocalPort());
System.out.println(" of " + socket.getLocalAddress());
} catch(UnknownHostException e) {
e.printStackTrace();
} catch(SocketException e) {
e.printStackTrace();
} catch(IOException e) {
e.printStackTrace();
}[/CODE]
Chương trình sau thực hiện công việc gì?
A. Kết nối đến một webserver nào đó.
B. Tạo một địa chỉ IP từ mảng byte, chuỗi String.
C. Cho địa chỉ, tìm tên máy.
D. Không có đáp án đúng.
try {
Socket socket = new Socket(args, 80);
System.out.print("Connected to " + socket.getInetAddress());
System.out.print(" on port " + socket.getPort());
System.out.print(" from port " + socket.getLocalPort());
System.out.println(" of " + socket.getLocalAddress());
} catch(UnknownHostException e) {
e.printStackTrace();
} catch(SocketException e) {
e.printStackTrace();
} catch(IOException e) {
e.printStackTrace();
}[/CODE]
Chương trình sau thực hiện công việc gì?
A. Kết nối đến một webserver nào đó.
B. Tạo một địa chỉ IP từ mảng byte, chuỗi String.
C. Cho địa chỉ, tìm tên máy.
D. Không có đáp án đúng.
Chọn D là đáp án đúng