Decimal to Hexadecimal Converter in Java
问题 I have a homework assignment where I need to do three-way conversion between decimal, binary and hexadecimal. The function I need help with is converting a decimal into a hexadecimal. I have nearly no understanding of hexadecimal, nonetheless how to convert a decimal into hex. I need a function that takes in an int dec and returns a String hex . Unfortunately I don't have any draft of this function, I'm completely lost. All I have is this. public static String decToHex(int dec) { String hex =