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