MCQs City stays free thanks to ads. Please turn off your ad blocker for this site so content and features keep working.
Computer Networks
Computer Networks Assessment
Q
Which constructor of Datagram Socket class is used to create a datagram socket and binds it with the given Port Number?
AA. Datagram socket(int port)
BB. Datagram socket(int port, int address address)
CC. Datagram socket()
DD. Datagram socket(int address)
Correct Answer:
B. B. Datagram socket(int port, int address address)
Explanation:
Datagram Socket (int port, Int Address address) is used to create a datagram socket. A datagram socket is created for connection-less communication between the server and the client. There is no accept() method in this class.