Can someone explain to me if there is a difference between classes InetAddressand InetSocketAddressin java, and if there is a difference, please explain the same. I google-ed this, but I could not find anything explanatory.
InetAddress
InetSocketAddress
Inetaddress
An InetAddress instance consists of an IP address and possibly the corresponding host name
This class implements an IP-Socket address (IP address + port number). It can also be a pair (hostname + port number), in which case an attempt will be made to resolve the hostname
They represent various OSI layers :
An InetAddress ( 3) IP-.
A InetSocketAddress Transport Layer (Layer 4) IP- .