Network Interface in Java
A network interface is the point of interconnection between a computer and a private or public network. A network interface is generally a network interface card (NIC). Java 1.4 introduced NetworkInterface Class to get the details of a local network interface, MAC address of the Interface, MTU (maximum transmission unit) of the Interface, list of IP address attached to the interface whether the interface up and/or down and whether it supports multicasting etc.
NetworkInterface is useful for a multihomed system, which is a system with multiple NICs. Using NetworkInterface, you can specify which NIC to use for particular network activity. The NetworkInterface class is given by Java in a package named java.net and the NetworkInterface class represents both types of interfaces.
Example
The loop back interface (127.0.0.1 for IPv4 and 1 for IPv6) is not a physical device but a piece of software simulating a network interface. The loop back interface is commonly used in test environments.
code
The following output provides many information from the NIC (Network Interface Card) of your system.
Resource