This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one 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.