Here you can find the source of getLocalHost()
public static InetAddress getLocalHost()
//package com.java2s; import java.net.InetAddress; public class Main { private static InetAddress localhost = null; /**/*from w w w . ja va 2 s .co m*/ * Gets the set localhost address * @return The localhost address */ public static InetAddress getLocalHost() { return localhost; } }