The java.net.Socket is mainly a class, which is very useful class, this is defined as :
- We can connect to remote machines;
- We can send data;
- We can receive data;
- We can close the connection.
- The java.net.Socket class allows us to create socket objects that perform all four fundamental socket operation.
- Each Socket object is associated with exactly one remote host. To connect to a different host, We must create a new Socket object.