Basic concept of Networking - Java (MCQ) questions and answers

1)   URL is an acronym for?
- Published on 16 Jul 15

a. Uniform Resource Locator
b. Unified Resource Locator
c. Uniform Restore Locator
d. Unified Restore Locator
Answer  Explanation 

ANSWER: Uniform Resource Locator

Explanation:
No explanation is available for this question!


2)   URL stands for Uniform Resource Locator and represents a resource on the World Wide Web, such as a Web page or FTP directory.
- Published on 15 Jul 15

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


3)   Which class is used to create servers that listen for either local client or remote client programs?
- Published on 15 Jul 15

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

ANSWER: ServerSockets

Explanation:
No explanation is available for this question!


4)   Which constructor of DatagramSocket class is used to creates a datagram socket and binds it with the given Port Number?
- Published on 15 Jul 15

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

ANSWER: DatagramSocket(int port, InetAddress address)

Explanation:
No explanation is available for this question!


5)   Which methods are commonly used in ServerSocket class?
- Published on 15 Jul 15

a. public OutputStream getOutputStream()
b. public Socket accept()
c. public synchronized void close()
d. None of the above
Answer  Explanation 

ANSWER: public Socket accept()

Explanation:
No explanation is available for this question!


6)   Which classes are used for connection-less socket programming?
- Published on 15 Jul 15

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

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


7)   Which method of URL class represents a URL and it has complete set of methods to manipulate URL in Java?
- Published on 15 Jul 15

a. java.net.URL
b. java.net.URLConnection
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: java.net.URL

Explanation:
No explanation is available for this question!


8)   Which class is used to create servers that listen for either local client or remote client programs?
- Published on 13 Jul 15

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

ANSWER: ServerSockets

Explanation:
No explanation is available for this question!


9)   Which package provides core functionality?
- Published on 13 Jul 15

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

ANSWER: java.lang

Explanation:
No explanation is available for this question!


10)   The DatagramSocket and DatagramPacket classes are not used for connection-less socket programming.
- Published on 13 Jul 15

a. True
b. False
Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


1 2