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();
}
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.
Hướng dẫn
Chọn D là đáp án đúng
Thư viện tài liệu12 Tháng bảy, 2023 @ 2:51 chiều