Java Networking Question and Answers

9. What are the two important TCP Socket classes?
 
  • Socket and ServerSocket.
  • ServerSocket is used for normal two way socket communication.
  • Socket class allows us to read and write through the sockets.
  • getInputStream() and getOutputStream() are the two methods available in Socket class.
 
Your Name Your Email-ID
Your Answer
10. What information is needed to create a TCP Socket?
 
  • The Local System’s IP Address and Port Number.
  • And the Remote System’s IP Address and Port Number.
 
Your Name Your Email-ID
Your Answer
11. In OSI N/W Architecture, the routing is performed by which layer?
  Network Layer
 
Your Name Your Email-ID
Your Answer
12. Which class is used by server applications to obtain a port and listen for client requests?
  java.net.ServerSocket class is used by server applications to obtain a port and listen for client requests.
 
Your Name Your Email-ID
Your Answer
1234 Page 3 of 4