1.

Which constructor of Datagram Socket class is used to create a datagram socket and binds it with the given Port Number?(a) Datagram Socket(int port)(b) Datagram Socket(int port, Int Address address)(c) Datagram Socket()(d) Datagram Socket(int address)

Answer» Correct option is (b) Datagram Socket(int port, Int Address address)

To explain I would say: 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.


Discussion

No Comment Found

Related InterviewSolutions