Results 1 to 1 of 1
-
How to convert integer to the hexadecimal and octal number
This example code takes the help of Integer class and converts the integer to the octal and hexadecimal number.
Java Code:public class HexaOctalExp { public static void main(String[] args) { int i = 74; String hexString = Integer.toHexString( i ); String octString = Integer.toOctalString( i ); System.out.println("Hexa decimal conversion "+hexString); System.out.println("Octal coversion "+octString); } }
Similar Threads
-
how to convert String number to int
By gabriel in forum New To JavaReplies: 5Last Post: 08-02-2009, 03:46 PM -
Validate/Convert a number using the current Locale()
By Java Tip in forum Java TipReplies: 0Last Post: 03-01-2008, 10:01 PM -
How do I convert a decimal value to hexadecimal with double precision (64 bit)
By SKaur in forum New To JavaReplies: 7Last Post: 01-12-2008, 09:02 PM -
Integer vs int
By bugger in forum New To JavaReplies: 1Last Post: 11-14-2007, 09:13 PM -
Help with convert a double type number
By trill in forum New To JavaReplies: 1Last Post: 08-06-2007, 08:48 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks