Network_Interfaces1

A network interface is the point of interconnection between a computer and a private or public network

Output:

Complete code :

public class ClassTemplate1 {

public ClassTemplate1() {
// TODO Auto-generated constructor stub
}

public static void main(String[] args) throws IOException
{
Enumeration<NetworkInterface> nets =
NetworkInterface.getNetworkInterfaces();
System.out.println("-Enumeration<NetworkInterface> ----");
for (NetworkInterface netIf : Collections.list(nets)) {
System.out.printf("getDisplayName(): %s\n ", netIf.getDisplayName());
out.printf("getName(): %s\n ", netIf.getName());
out.printf("InetAddress: %s\n ", netIf.getInetAddresses() );
out.printf("subinterface: %s\n ", netIf.getSubInterfaces() );
out.printf("Index: %s\n ", netIf.getIndex());
System.out.println("-----");
}
}

}