Question: 1)Sockets in Java come in at least three varieties that are implemented by the Socket, DatagramSocket and ServerSocket Java classes. The first two socket classes

1)Sockets in Java come in at least three varieties that are implemented by the Socket, DatagramSocket and ServerSocket Java classes. The first two socket classes represent TCP and UDP communications respectively. The first two socket classes are used to implement both clients and servers. The ServerSocket class is only used to implement servers. Explain these three Java classes comparing each other and define the low-level mechanism of socket programming?

2) Write a Java socket client example and explain what happened in detail.

3) Write a Java socket server example and explain what happened in detail.




Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets address each part of your question step by step 1 Comparison of Java Socket Classes Socket class This class represents a TCP socket used for clientserver communication over TCPIP networks It esta... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!