This week's book giveaway is in the OCAJP forum. We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line! See this thread for details.
Why wrapper class Integer has 2 methods to convert a base 10 int to a Hex (base 16) string ? static String toString(int i, int radix) static String toHexString(int i) eg: to convert 15 to F Integer.toHexString(15) returns f Integer.toString(15, 16) also returns f
If we already have the generic method static String toString(int i, int radix) why do we still need static String toHexString(int i) ? Doesn’t the former makes the latter unnecessary ?
posted 13 years ago
For conveniance, in case you do not want to have to specify the default radix each time you use the method.