Number Of Page View:100,000+/Months
LOGIN |New User


toXxxString() (Binary, Hexadecimal, Octal)
The Integer and Long wrapper classes let we convert numbers in base 10 to other bases. These conversion methods, toXxxString(), take an int or long, and return a String representation of the converted number, for example : 
String s3 = Integer.toHexString(254); // convert 254 to hex
System.out.println("254 in hex = " + s3); // result is "254 in hex = fe"
String s4 = Long.toOctalString(254); // convert 254 to octal
System.out.println("254 in octal = "+ s4); // result is "254 in octal = 376"
Posted By: Name:Rajesh Kr URL: toXxxString() (Binary, Hexadecimal, Octal)