NetworkInterface isVirtual Example

NetworkInterface class isVirtual example. This example shows you how to use isVirtual method.


NetworkInterface class isVirtual example. public boolean isVirtual() Returns whether this interface is a virtual interface (also called subinterface). Virtual interfaces are, on some systems, interfaces created as a child of a physical interface and given different settings (like address or MTU).

Here is the code
/*
 * @ # isVirtual.java
 * A class repersenting use to isVirtual method 
 * of URL class in java.net package
 * version 23 June 2008
 * author Rose India 
 */

import java.net.*;

public class
IsVirtual {

    public static void main(String args[]) throws Exception {

        byte b[] {127001};
        InetAddress inetAddress = InetAddress.getByAddress(b);
        NetworkInterface networkInterface =
                NetworkInterface.getByInetAddress(inetAddress);
        System.out.println("network interface is virtual " +
                networkInterface.isVirtual());
    }
}

Output
network interface is virtual false

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US