Filters
Question type

Study Flashcards

A page not found has status code _______________.


A) 200 not found.
B) 404 not found.
C) 0 not found.
D) 100 not found.

E) B) and C)
F) A) and B)

Correct Answer

verifed

verified

B

The ______ method empties the buffer and forwards all waiting characters to the destination.


A) print
B) send
C) scan
D) flush

E) A) and D)
F) None of the above

Correct Answer

verifed

verified

D

The ____ is used to download received messages from e-mail servers.


A) SMTP
B) TCP
C) IP
D) POP

E) None of the above
F) A) and D)

Correct Answer

verifed

verified

IP breaks up large chunks of data into more manageable ____________________.


A) packets
B) sockets
C) application data
D) network protocol data

E) None of the above
F) All of the above

Correct Answer

verifed

verified

Which of the following statements is correct?


A) HTML is a protocol that describes the command set for web server requests.
B) Web servers know how to display HTML documents.
C) Web servers know how to issue HTTP commands.
D) The Telnet program is not a browser and does not understand HTML tags.

E) None of the above
F) B) and D)

Correct Answer

verifed

verified

Write a code fragment that connects to a server running on gorge.divms.uiowa.edu at port 2345 and sends the message "Hello server" to the server and then reads the one-line response from the server.


A) Socket sock = new Socket(2345, gorge.divms.uiowa.edu) ;
PrintWriter pw = new PrintWriter(sock.getOutputStream() ) ;
Pw) println("Hello server") ;
Pw) flush() ;
String line = scan.nextLine() ;
Scanner scan = new Scanner(sock.getInputStream() ) ;
B) Socket sock = new Socket(gorge.divms.uiowa.edu) ;
PrintWriter pw = new PrintWriter(sock.getOutputStream() , 2345) ;
Pw) println("Hello server") ;
Pw) flush() ;
Scanner scan = new Scanner(sock.getInputStream() ) ;
String line = scan.nextLine() ;
C) Socket sock = new Socket(gorge.divms.uiowa.edu, 2345) ;
PrintWriter pw = new PrintWriter(sock.getOutputStream() ) ;
Pw) println("Hello server") ;
Pw) flush() ;
Scanner scan = new Scanner(sock.getInputStream() ) ;
String line = scan.nextLine() ;
D) Socket sock = new Socket(gorge.divms.uiowa.edu, 2345) ;
PrintWriter pw = new PrintWriter(sock.getInputStream() ) ;
Pw) println("Hello server") ;
Pw) flush() ;
Scanner scan = new Scanner(sock.getOutputStream() ) ;
String line = scan.nextLine() ;

E) C) and D)
F) B) and D)

Correct Answer

verifed

verified

Each IP ____ is delivered separately, and each one that is a part of the same transmission can take different routes through the Internet.


A) packet
B) socket
C) address
D) port number

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

Suppose you use the URLGet program in Section 21.5 to get a web page from a server that does not exist, such as http://wombat.java/index.html. What will happen?


A) The call to the URL constructor will throw an exception.
B) The call to getResponseCode will throw an exception.
C) The call to getResponseCode will return the error code 404.
D) The call to getInputStream will throw an exception.

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

Which code fragment creates a server running at port 6666 and sends one line of text, "Hello from earth" over and over to any machine that connects to the server.


A) ServerSocket ss = new ServerSocket(6666) ;
Socket sock = ss.accept() ;
While (true)
{
PrintWriter pw = new PrintWriter(sock.getOutputStream() ) ;
Pw) println("Hello from earth") ;
Pw) flush() ;
Pw) close() ;
}
B) ServerSocket ss = new ServerSocket(6666) ;
While (true)
{
PrintWriter pw = new PrintWriter(sock.getOutputStream() ) ;
Pw) println("Hello from earth") ;
Socket sock = ss.accept() ;
}
C) ServerSocket ss = new ServerSocket(6666) ;
While (true)
{
Socket sock = ss.accept() ;
PrintWriter pw = new PrintWriter(sock.getOutputStream() ) ;
Pw) println("Hello from earth") ;
Pw) flush() ;
Pw) close() ;
}
D) Socket sock = ss.accept() ;
While (true)
{
ServerSocket ss = new ServerSocket(6666) ;
PrintWriter pw = new PrintWriter(sock.getOutputStream() ) ;
Pw) println("Hello from earth") ;
Pw) flush() ;
Pw) close() ;
}

E) C) and D)
F) All of the above

Correct Answer

verifed

verified

What are among the most important pieces of information that must be included in an IP packet? I. The Internet address of the recipient II. The URL of the recipient III. The Internet address of the sender IV. The port number of the sender


A) I, III, and IV
B) I, II, and III
C) II, III, and IV
D) I, II, III, and IV

E) C) and D)
F) All of the above

Correct Answer

verifed

verified

To open a connection, which of the following statements can you use?


A) URL u = new URL("http://www.yahoo.com") ;
URLConnection conn = u.open() ;
B) URL u = new URL("http://www.yahoo.com") ;
URLConnection conn = new URLConnection(u) ;
C) URL u = new URL("http://www.yahoo.com") ;
URLConnection conn = u.openURLConnection() ;
D) URL u = new URL("http://www.yahoo.com") ;
URLConnection conn = u.openConnection() ;

E) All of the above
F) A) and D)

Correct Answer

verifed

verified

_________ objects are used for communication (IO) between two computers (client and server) .


A) ServerSocket
B) Socket
C) ClientSocket
D) Packet

E) A) and C)
F) C) and D)

Correct Answer

verifed

verified

Which of the following HTTP commands supplies input to a server-side command and returns the result?


A) CONNECT
B) DELETE
C) HEAD
D) POST

E) A) and B)
F) A) and D)

Correct Answer

verifed

verified

D

The term _____________ data refers to the data that describe how to reach the intended recipient and how to check for errors and data loss in the transmission.


A) packet
B) socket
C) application data
D) network protocol

E) All of the above
F) A) and C)

Correct Answer

verifed

verified

The ____ program is a useful tool for establishing test connections with servers.


A) DNS
B) HTML
C) Telnet
D) TCP

E) C) and D)
F) B) and D)

Correct Answer

verifed

verified

What does TCP/IP stand for?


A) Transmission Control and Internet Protocol.
B) Transmission Control Protocol and Internet Protocol.
C) Transmission Protocol and Internet Protocol.
D) Transmission Control Protocol over Internet Protocol.

E) A) and C)
F) None of the above

Correct Answer

verifed

verified

The ____________ has one function, to attempt to deliver data from one computer to another across the Internet.


A) TCP/IP
B) IP
C) HTTP
D) DNS

E) C) and D)
F) B) and C)

Correct Answer

verifed

verified

For the server to execute the run method in a separate thread for each client, the application program needs to implement the _____ interface.


A) Running
B) Runtime
C) Server
D) Runnable

E) A) and B)
F) None of the above

Correct Answer

verifed

verified

What does the acronym POP stand for?


A) Point to Point
B) Post Office Point
C) Protocol Of Point
D) Post Office Protocol

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

When you communicate with a mail server, you ___________, or you can learn how to use Java mail extensions.


A) can write programs that send GET and POP commands.
B) can write programs that send SMTP and POST commands.
C) can write programs that send GET and POST commands
D) can write programs that send SMTP and POP commands.

E) A) and B)
F) None of the above

Correct Answer

verifed

verified

Showing 1 - 20 of 74

Related Exams

Show Answer