Can anyone please explain me is there is any difference between InetAddress and InetSocketAddress classes in java, and if there is a difference, please explain the same. I google-ed it up but I couldn’t find anything explanatory.
Can anyone please explain me is there is any difference between InetAddress and InetSocketAddress
Share
InetAddress
An instance of an InetAddress consists of an IP address and possibly its corresponding host name
InetSocketAddress
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