Java examples for java.lang:int Format
ip Int To String
//package com.java2s; public class Main { public static void main(String[] argv) { int ip = 4223; System.out.println(ipIntToString(ip)); }// w w w . j av a 2 s . co m public static String ipIntToString(int ip) { // @formatter:off return String.format("%d.%d.%d.%d", (ip & 0xff), (ip >> 8 & 0xff), (ip >> 16 & 0xff), (ip >> 24 & 0xff)); // @formatter:on } }