The Java Tutorials have been written for JDK 8.Java教程是为JDK 8编写的。Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.本页中描述的示例和实践没有利用后续版本中引入的改进,并且可能使用不再可用的技术。See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.有关Java SE 9及其后续版本中更新的语言特性的摘要,请参阅Java语言更改。
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.有关所有JDK版本的新功能、增强功能以及已删除或不推荐的选项的信息,请参阅JDK发行说明。
Systems often run with multiple active network connections, such as wired Ethernet, 系统通常使用多个活动网络连接运行,例如有线以太网、802.11 b/g
(wireless), and bluetooth. 802.11 b/g
(无线)和蓝牙。Some applications might need to access this information to perform the particular network activity on a specific connection.某些应用程序可能需要访问这些信息,才能在特定连接上执行特定的网络活动。
The java.net.NetworkInterface
class provides access to this information.java.net.NetworkInterface
类提供对这些信息的访问。
This lesson guides you through some of the more common uses of this class and provides examples that list all the network interfaces on a machine as well as their IP addresses and status.本课程将指导您了解此类的一些更常见的用法,并提供示例,列出机器上的所有网络接口及其IP地址和状态。
This page describes a network interface and explains why you might want to use it.本页描述了一个网络接口,并解释了您可能想要使用它的原因。
This page contains an example that illustrates how a client program can retrieve all the network interfaces on a machine.本页包含一个示例,说明客户端程序如何检索机器上的所有网络接口。
This page shows you how to list the IP addresses assigned to all the network interfaces on a machine.本页显示如何列出分配给机器上所有网络接口的IP地址。
This page shows you how to determine whether a network interface is running or if the network interface is a loopback interface, a point-to-point interface, or a virtual interface. 此页面显示如何确定网络接口是否正在运行,或者网络接口是环回接口、点对点接口还是虚拟接口。You can also learn how to determine if the interface supports multicasting.您还可以了解如何确定接口是否支持多播。