Multiple choice technology programming languages

class JJF4 { public static void main(String args[]) { System.out.print(Long.toHexString(Byte.MAX_VALUE)+","); System.out.print(Long.toHexString(Character.MAX_VALUE)+","); System.out.print(Long.toHexString(Short.MAX_VALUE)); }}

  1. Prints: f,ff,7f

  2. Prints: f,ff,ff

  3. Prints: 7f,ffff,7fff

  4. Prints: ff,ffff,ffff

  5. Prints: 7fff,ffffff,7fffff

  6. Prints: ffff,ffffff,ffffff

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Byte.MAX_VALUE = 127 = 0x7f. Character.MAX_VALUE = 65535 = 0xffff. Short.MAX_VALUE = 32767 = 0x7fff. Long.toHexString converts each to hex string representation without leading zeros.