1. Home
  2. /
  3. Docs
  4. /
  5. Network Programming
  6. /
  7. Internet Address
  8. /
  9. The Network Interface Cla...

The Network Interface Class

The NetworkInterface class represents a local IP address. This can either be a physical interface such as an additional Ethernet card (common on firewalls and routers) or it can be a virtual interface bound to the same physical hardware as the machine’s other IP addresses. The NetworkInterface class provides methods to enumerate all the local addresses, regardless of interface, and to create InetAddress objects from them. These InetAddress objects can then be used to create sockets, server sockets, and so forth.

Factory Method

public static NetworkInterface getByName(String name) throws SocketException

public static NetworkInterface getByInetAddress(InetAddress address) throws SocketException

public static Enumeration getNetworkInterfaces() throws SocketException

Getter Method

public Enumeration getInetAddresses()

public String getName()

public String getDisplayName()


Still stuck? Contact

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *

All Rights Reserved 2025.