Is there a hexadecimal data type in Java?

Hi,
  Is there a hexadecimal data type in Java?

Thanks!
pbenitoAsked:
Who is Participating?
 
javaexpertoConnect With a Mentor Commented:
Of course Integral literals may be represented by decimal, octal, or hexadecimal numbers. The hexadecimal numbers are prefixed with hexadecimal with 0x or 0X. Example:

int x = 0x2b;
int x = 0x2B;
int x = 0X2b;
int x = 0X2B;
0
 
spoxoxConnect With a Mentor Commented:
This (from Integer) might be useful...

 static String toBinaryString(int i)  
           Returns a string representation of the integer argument as an  unsigned integer in base 2.    static String toHexString(int i)  
           Returns a string representation of the integer argument as an  unsigned integer in base 16.    static String toOctalString(int i)  
           Returns a string representation of the integer argument as an  unsigned integer in base 8.


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.