开发者

Different Outputs_networking

Different Outputs_networking

import java.net.*;
 class check {
  public static void main(String args[])throws Exception {
   InetAddress address=InetAddress.getLocalHost();
   System.out.println(address);
 }
}

Now the first output is when i am connected to internet开发者_JAVA百科 and second output is when i am not connected to internet. What type of ip address is the second one? (the one encapsulated in InetAddress with internet not working)

Please help me in this.


127.0.0.1 is the loopback address. It's always present on your computer. When you don't have an externally accessible IP assigned to your machine, that's your local address.


127.0.0.1 is the canonical loopback address, in short, it's an always-available address of your own machine.

Actually, just googling this address brings relevant info instantly.


127.0.0.1 is the default loopback address of any machine when its no assigned particular ip

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜