Basic concepts of Java networking MCQ Set-2

Errorlogger
1

1) Which class is message that can be sent or received. If you send multiple packet, it may arrive in any order,Moreover, packet delivery is not guaranteed?
A) DatagramPacket
B) DatagramSocket
C) Both A & B
D) None of the above


2) Which constructor of DatagramSocket class is used that it 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 above


3) 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


4) The flush() method of PrintStream class flushes any uncleared buffers in memory?
A) True
B) False


5) Which method of URL class represents a URL and 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


6) URL stands for Uniform Resource Locator and represents a resource on the World Wide Web, such as a Web page or FTP directory?
A) True
B) False


7) Which package provides core functionality?
A) java.net
B) java.rmi
C) java.lang
D) java.math


8) These networking classes encapsulate the "socket" paradigm pioneered in the (BSD) Give the abbrevation of BSD?
A) Berkeley Software Distribution
B) Berkeley Socket Distribution
C) Berkeley System Distribution
D) None of the above


9) 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


10) 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


11) Datagram is basically an information but there is no guarantee of its content, arrival or arrival time.
A) True
B) False


12) The DatagramSocket and DatagramPacket classes are not used for connection-less socket programming.
A) True
B) False
Tags

Post a Comment

1Comments

Post a Comment

#buttons=(Accept !) #days=(30)

Our website uses cookies to enhance your experience. Check Now
Accept !