📚 Practice Mode

programming languages Online Quiz - 307

Learn at your own pace with hints and detailed explanations

1 / 20
Multiple Choice

class B { public static void main (String args[]) { Double a = new Double(0xFFFF); byte b = a.byteValue(); short c = a.shortValue(); int e = a.intValue(); long f = a.longValue(); float g = a.floatValue(); double h = a.doubleValue(); System.out.print(b+","+c+","+ (e+f+g+h == 4 * 0xFFFF)); }} What is the result of attempting to compile and run the program?

  1. Prints: 0xFFFF,0xFFFF,false
  2. Prints: 0xFFFF,0xFFFF,true
  3. Prints: -1,-1,false
  4. Prints: -1,-1,true
  5. Compile-time error