Computer Networks Assessment MCQs

9 MCQs  — Computer Networks MCQs

Practice Computer Networks Assessment MCQs with correct answers and explanations. These questions are from the Computer Networks MCQs section.

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 client in socket programming must know which information?
A. Ip address of server
B. Port number
C. Both ip address of server & port number
D. Only its own ip address
Which classes are used for connection-less socket programming?
A. Datagram socket
B. Datagram packet
C. Both datagram socket & datagram packet
D. Server socket
In Inet Address class, which method returns the host name of the IP Address?
A. Public string get hostname()
B. Public string gethostaddress()
C. Public static inetaddress get localhost()
D. Public getbyname()