You are on page 1of 1

21. Which method is used to set the size of the receive buffer for a socket in Java?

A)
setReceiveBufferSize() B) setBufferSize() C) setSocketBufferSize() D) setBuffer()

22. In Java socket programming, which class is used to represent an IP address? A) InetAddress
B) IPAddress C) SocketAddress D) NetworkAddress

23. Which method is used to retrieve the local address to which the socket is bound in Java? A)
getLocalAddress() B) getRemoteAddress() C) getSocketAddress() D) getInetAddress()

24. What is the purpose of the SocketTimeoutException in Java socket programming? A) To


handle errors during socket creation. B) To specify a timeout for socket operations. C) To
indicate a connection refusal by the server. D) To represent a problem with network
hardware.

25. Which method is used to set the performance preferences for a socket in Java? A)
setPerformancePreferences() B) setSocketOptions() C) setConnectionPreferences() D)
setPerformanceOptions()

You might also like