Inet4Address IsMCNodeLocal() Example
returns a boolean if the address has a multicast address of node-local scope
Inet4Addressclass IsMCNodeLocal() method example. This example shows you how to use IsMCNodeLocal() method.This method returns a boolean if the address has a multicast address of node-local scope
Here is the code:-
/*
* @Program to check if the multicast address has node scope
* IsMCNodeLocal.java
* Author:-RoseIndia Team
* Date:-28-Jun-2008
*/
import java.net.*;
import java.util.*;
public class IsMCNodeLocal {
public static void main(String[] args) throws Exception {
InetAddress i = Inet4Address.getByName("localhost");
boolean b = i.isMCNodeLocal();
System.out.println("Multicast address has node scope: " + b);
}
} |
Output of the program:-
| Multicast address has node scope: false |
|