InetAddress.isSiteLocalAddress() has the following syntax.
public boolean isSiteLocalAddress()
In the following code shows how to use InetAddress.isSiteLocalAddress() method.
import java.net.InetAddress; //from w ww . ja va 2s .c o m public class Main { public static void main(String[] argv) throws Exception { InetAddress address = InetAddress.getByName("web.mit.edu"); System.out.println("Name: " + address.getHostName()); System.out.println("Addr: " + address.getHostAddress()); System.out.println(address.isSiteLocalAddress()); } }
The code above generates the following result.