Java InetAddress .isMulticastAddress ()
Syntax
InetAddress.isMulticastAddress() has the following syntax.
public boolean isMulticastAddress()
Example
In the following code shows how to use InetAddress.isMulticastAddress() method.
import java.net.InetAddress;
/*from w ww . j av a2s . c om*/
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.isMulticastAddress());
}
}
The code above generates the following result.