InetAddress IsAnyLocalAddress() Example
Utility routine to check if the InetAddress in a wildcard address.
InetAddressclass IsAnyLocalAddress() method example. This example shows you how to use IsAnyLocalAddress() method.This method gives Utility routine to check if the InetAddress in a wildcard address.
Here is the code:-
/*
* @Program that gives Utility routine to check if the InetAddress in a
wildcard address.
* IsAnyLocalAddress.java
* Author:-RoseIndia Team
* Date:-19-Jun-2008
*/
import java.net.*;
public class IsAnyLocalAddress {
public static void main(String[] args)throws UnknownHostException {
InetAddress ia = InetAddress.getLocalHost();
System.out.println("Inetaddress is a wildcard address: "+ia.isAnyLocalAddress());
}
} |
Output of the program:-
| Inetaddress is a wildcard address: false |
|