這個類表示互聯(lián)網(wǎng)協(xié)議(IP)地址。下面列出了Socket編程時比較有用的方法:
序號 | 方法描述 |
1 | static InetAddress getByAddress(byte[] addr) 在給定原始 IP 地址的情況下,返回 InetAddress 對象。 |
2 | static InetAddress getByAddress(String host, byte[] addr) 根據(jù)提供的主機名和 IP 地址創(chuàng)建 InetAddress。 |
3 | static InetAddress getByName(String host) 在給定主機名的情況下確定主機的 IP 地址。 |
4 | String getHostAddress() 返回 IP 地址字符串(以文本表現(xiàn)形式)。 |
5 | String getHostName() 獲取此 IP 地址的主機名。 |
6 | static InetAddress getLocalHost() 返回本地主機。 |
7 | String toString() 將此 IP 地址轉(zhuǎn)換為 String。 |
2015職稱計算機考試書PowerPoint2007中 .. 定價:¥45 優(yōu)惠價:¥42 更多書籍 | |
2015年全國職稱計算機考試教材(2007模 .. 定價:¥225 優(yōu)惠價:¥213 更多書籍 |