Nothing Special   »   [go: up one dir, main page]

Assignment AJP

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Assignment

1. URL is an acronym for?

a. Uniform Resource Locator


b. Unified Resource Locator
c. Uniform Restore Locator
d. Unified Restore Locator

2. Which class is used to create servers that listen for either local client or remote
client programs?

a. ServerSockets
b. httpServer
c. httpResponse
d. None of the above

3. Which constructor of DatagramSocket class is used to creates a datagram socket


and binds it with the given Port Number?

a. DatagramSocket(int port)
b. DatagramSocket(int port, InetAddress address)
c. DatagramSocket()
d. None of the abov

4. Which methods are commonly used in ServerSocket class?

a. public OutputStream getOutputStream()


b. public Socket accept()
c. public synchronized void close()
d. None of the above

5. Which classes are used for connection-less socket programming?

a. DatagramSocket
b. DatagramPacket
c. Both A & B
d. None of the above

6. Which method of URL class represents a URL and it has complete set of methods to
manipulate URL in Java?

a. java.net.URL
b. java.net.URLConnection
c. Both A & B
d. None of the above
7. Which package provides core functionality?

a. java.net
b. java.rmi
c. java.lang
d. java.math

8. The DatagramSocket and DatagramPacket classes are not used for connection-less
socket programming.

a. True
b. False

9. The client in socket programming must know which informations?

a. IPaddress of Server
b. Port number
c. Both A & B
d. None of the above

10. The URLConnection class can be used to read and write data to the specified
resource referred by the URL

a. True
b. False

11. Datagram is basically an information but there is no guarantee of its content, arrival
or arrival time.

a. True
b. False

12. What does the java.net.InetAddress class represent?

a. Socket
b. IP Address
c. Protocol
d. MAC Address

13. TCP,FTP,Telnet,SMTP,POP etc. are examples of ?

a. Socket
b. IP Address
c. Protocol
d. MAC Address
14. In InetAddress class which method returns the host name of the IP Address?

a. public String getHostName()


b. public String getHostAddress()
c. public static InetAddress getLocalHost()
d. None of the above

15. Which steps occur when establishing a TCP connection between two computers
using sockets?

a. The server instantiates a ServerSocket object, denoting which port number


communication is to occur on
b. The server invokes the accept() method of the ServerSocket class. This method
waits until a client connects to the server on the given port
c. After the server is waiting, a client instantiates a Socket object, specifying the
server name and port number to connect to
d. All of the above

You might also like