2. Which constructor of Datagram Socket class is used to create a datagram socket and binds it with the given Port Number? Explanation: Datagram Socket (int port, Int Address address) is used to create a datagram socket.
Which constructor of DatagramSocket class is?
Commonly used Constructors of DatagramSocket class
DatagramSocket(int port) throws SocketEeption: it creates a datagram socket and binds it with the given Port Number.
What protocol is used by the DatagramSocket class?
The DatagramSocket class implements packet-oriented, connectionless data communication. In Internet parlance, this is the User Datagram Protocol, commonly known as UDP (see RFC 768).