
Trắc nghiệm Lập trình Mạng - Đại học Kinh doanh và Công nghệ Hà Nội (HUBT)
Bộ câu hỏi trắc nghiệm về Lập trình Mạng dành cho sinh viên Đại học Kinh doanh và Công nghệ Hà Nội (HUBT). Tài liệu giúp ôn tập và củng cố kiến thức về giao thức mạng, lập trình socket, các mô hình truyền thông TCP/IP, UDP và ứng dụng thực tế. Hỗ trợ sinh viên chuẩn bị tốt cho các kỳ thi học phần và nâng cao kỹ năng lập trình mạng chuyên sâu.
Từ khoá: trắc nghiệm Lập trình Mạng Đại học Kinh doanh và Công nghệ Hà Nội HUBT giao thức mạng lập trình socket TCP/IP UDP mô hình truyền thông ôn tập công nghệ thông tin câu hỏi trắc nghiệm luyện thi lập trình mạng
Số câu hỏi: 240 câuSố mã đề: 6 đềThời gian: 1 giờ
14,919 lượt xem 1,144 lượt làm bài
Xem trước nội dung:
"1. try {"
"2. ServerSocket server = new ServerSocket(5000);"
"3. Socket client = server.accept();"
"4. InputStream inStream = client.getInputStream();"
"5. OutputStream outStream = client.getOutputStream();"
"6. Scanner in = new Scanner(inStream);"
"7. PrintWriter out = new PrintWriter(outStream,true);"
"8. out.println(""Hello! Enter \""exit\"" to logout"");"
"9. boolean done = false;"
"10. while (!done && in.hasNextLine()) {"
"11. String line = in.nextLine();"
"12. if (line.equals(""browse web"")) {"
"13. out.println(""Mo chuong trinh duyet web"");"
"14. } else if (line.equals(""calculator""))"
"15. out.println(""Mo chuong trinh may tinh dien tu"");"
"16. else { out.println(""Echo "" + line); }"
"17. if (line.trim().equals(""exit"")) { done = true;}"
"18. }client.close(); } catch (IOException e) {}
"1. try {"
"2. ServerSocket server = new ServerSocket(5000);"
"3. Socket client = server.accept();"
"4. InputStream inStream = client.getInputStream();"
"5. OutputStream outStream = client.getOutputStream();"
"6. Scanner in = new Scanner(inStream);"
"7. PrintWriter out = new PrintWriter(outStream,true);"
"8. out.println(""Hello! Enter \""exit\"" to logout"");"
"9. boolean done = false;"
"10. while (!done && in.hasNextLine()) {"
"11. String line = out.nextLine();"
"12. if (line.equals(""browse web"")) {"
"13. out.println(""Mo chuong trinh duyet web"");"
"14. } else if (line.equal(""calculator""))"
"15. out.println(""Mo chuong trinh may tinh dien tu"");"
"16. else { out.println(""Echo "" + line); }"
"17. if (line.trim().equals(""exit"")) { done = true;}"
"18. }client.close() } catch (IOException e) {}
"try {"
" InetAddress myHost = InetAddress.getLocalHost();"
" System.out.println(myHost.getHostAddress());"
"} catch (UnknownHostException e) {"
" System.out.println(""Khong tim thay dia chi host"");"
"}
" class KiemTra { "
" private int i; "
" private int nextId; "
" public void setId() { "
" id = nextId; "
" nextId++; "
" } "
" } "
" Nếu khởi tạo 2 đối tượng class A extends KiemTra và class B extends KiemTra, id của đối tượng B có giá trị là ?
"1. try {"
"2. ServerSocket server = new ServerSocket(5000);"
"3. Socket client = server.accept();"
"4. InputStream inStream = client.getInputStream();"
"5. OutputStream outStream = client.getOutputStream();"
"6. Scanner in = new Scanner(inStream);"
"7. PrintWriter out = new PrintWriter(outStream,true);"
"8. out.println(""Hello! Enter \""exit\"" to logout"");"
"9. boolean done = false;"
"10. while (!done && in.hasNextLine()) {"
"11. String line = in.nextLine();"
"12. if (line.equals(""browse web"")) {"
"13. out.println(""Mo chuong trinh duyet web"");"
"14. } else if (line.equals(""calculator""))"
"15. out.println(""Mo chuong trinh may tinh dien tu"");"
"16. else { out.println(""Echo "" + line); }"
"17. if (line.trim().equals(""exit"")) { done = true;}"
"18. }client.close(); } catch (IOException e) {}
" Scanner in = new Scanner(System.in); "
" có tác dụng gì?
"1. for (int i = 0; i < args; i++) {"
"2. try {"
"3. Socket socket = new socket(args[i],80);"
"4. System.out.print(""Connected to "" + socket.getInetAddress());"
"5. System.out.print("" on port"" + socket.getPort());"
"6. System.out.print("" from port "" + socket.getLocalPort());"
"7. System.out.println("" of "" + socket.getLocalAddress());"
"8. } catch (UnknownHostException e) {"
"9. e.printStackTrace();"
"10. } catch (SocketException e) {"
"11. e.printStackTrace();"
"12. } catch (IOException e) {"
"13. e.printStackTrace();"
"14. }"
"15. }
"1. try "
"2. ServerSocket server = new ServerSocket(5000);"
"3. Socket client = server.accept();"
"4. InputStream inStream = server.getInputStream();"
"5. OutputStream outStream = client.getOutputStream();"
"6. Scanner in = new Scanner(outStream);"
"7. PrintWriter out = new PrintWriter(outStream,true);"
"8. out.println(""Hello! Enter \""exit\"" to logout"");"
"9. boolean done = false;"
"10. while (!done && in.hasNextLine()) {"
"11. String line = in.nextLine();"
"12. if (line.equals(""browse web"")) {"
"13. out.println(""Mo chuong trinh duyet web"");"
"14. } else if (line.equals(""calculator""))"
"15. out.println(""Mo chuong trinh may tinh dien tu"");"
"16. else { out.println(""Echo "" + line); }"
"17. if (line.trim().equals(""exit"")) { done = true;}"
"18. }client.close(); } catch (IOException e) {}
Đề thi tương tự
7 mã đề 265 câu hỏi 1 giờ
143,804 xem11,050 thi
1 mã đề 60 câu hỏi 1 giờ
13,542 xem1,031 thi
3 mã đề 114 câu hỏi 1 giờ
18,435 xem1,411 thi
5 mã đề 250 câu hỏi 1 giờ
41,188 xem3,161 thi
5 mã đề 246 câu hỏi 1 giờ
46,171 xem3,558 thi
3 mã đề 104 câu hỏi 1 giờ
144,453 xem11,157 thi
1 mã đề 25 câu hỏi 40 phút
91,974 xem7,070 thi