Here you can find the source of getIP(InetAddress ip)
public static String getIP(InetAddress ip)
//package com.java2s; //License from project: Creative Commons License import java.net.InetAddress; public class Main { public static String getIP(InetAddress ip) { return ip.getHostAddress().replace("/", ""); }/*w w w. j a va 2 s .c om*/ }