Advanced Java Programming (3160707) MCQs

MCQs of Java Networking

Showing 1 to 10 out of 21 Questions
1.
Which class creates a TCP server socket, bound to the specified port?
(a) Socket
(b) InetAddress
(c) ServerSocket
(d) DatagramSocket
Answer:

Option (c)

2.
Which class implements a connectionless packet delivery service.
(a) ServerSocket
(b) DatagramSocket
(c) InetAddress
(d) DatagramPacket
Answer:

Option (d)

3.
Which method of URL class returns the object of URLConnection class?
(a) getLocalHost()
(b) openConnection()
(c) getByName(String host)
(d) getHostAddress()
Answer:

Option (b)

4.
A Socket Consists Of?
(a) Port+IP address
(b) Only IP address
(c) only Port address
(d) None of these
Answer:

Option (a)

5.
Which method is establish a connection between server and client?
(a) accept()
(b) open()
(c) getLocalHost()
(d) openConnection()
Answer:

Option (a)

6.
Which constructor of DatagramSocket is used to creates a datagram socket and binds it with the a Port Number?
(a) DatagramSocket()
(b) DatagramSocket(int port, InetAddress address)
(c) DatagramSocket(int port)
(d) None of the above
Answer:

Option (b)

7.
Which classes are used for connection-less socket programming?
(a) DatagramSocket
(b) DatagramPacket
(c) Both A & B
(d) None of the above
Answer:

Option (c)

8.
How do you implement reliable transmission in UDP protocol?
(a) by sequencing packages
(b) by using Middleware
(c) A & B both
(d) None of the above
Answer:

Option (a)

9.
Which Protocol is generally used for multicast? TCP or UDP?
(a) TCP
(b) UDP
(c) A & B both
(d) None of these
Answer:

Option (b)

10.
How to get list of IP address that are assigned to a network interface?
(a) getInetAddresses()
(b) getInterfaceAddresses()
(c) A & B both
(d) None of these
Answer:

Option (c)

Showing 1 to 10 out of 21 Questions