Can anyone please explain me is there is any difference between InetAddress and InetSocketAddress classes in java, and if there is a difference, pl
InetAddress
InetSocketAddress
They represent different OSI layers:
An InetAddress corresponds to the Network Layer (Layer 3) and is basically an IP address.
A InetSocketAddress corresponds to the Transport Layer (Layer 4) and consists of an IP address and a port number.