Which constructor of Datagram Socket class is used to create a datagram socket and binds it with the given Port Number?

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: b
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.
 

Tìm kiếm

Back
Top