Multiple Choice
Write a code fragment that connects to a server running on gorge.divms.uiowa.edu at port 2345 and reads one line of text sent by the server.
A) Socket sock = new Socket(gorge.divms.uiowa.edu, 2345) ;
Scanner scan = new Scanner(sock.getOutputStream() ) ;
String line = scan.nextLine() ;
B) Socket sock = new Socket(gorge.divms.uiowa.edu, 2345) ;
Scanner scan = new Scanner(sock.getInputStream() ) ;
String line = scan.nextLine() ;
C) Scanner scan = new Scanner(sock.getInputStream() ) ;
Socket sock = new Socket(gorge.divms.uiowa.edu, 2345) ;
String line = scan.nextLine() ;
D) Socket sock = new Socket(2345, gorge.divms.uiowa.edu) ;
Scanner scan = new Scanner(sock.getInputStream() ) ;
String line = scan.next() ;
Correct Answer:

Verified
Correct Answer:
Verified
Q2: The HTTP command POST _.<br>A)returns the requested
Q7: IP breaks up large chunks of data
Q19: The HTTP command TRACE _.<br>A)traces the requested
Q26: The _ method empties the buffer and
Q34: A page not found has status code
Q47: When a web page is loaded, the
Q51: The term _ data refers to the
Q55: A(n) _ is a set of instructions
Q58: The _ translates domain names into Internet
Q69: The Java library provides a _ class