InterviewSolution
Saved Bookmarks
| 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)The question was posed to me in homework.Query is from Socket Programming in portion Networking of Computer Network |
|
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. |
|