Wrapper Classes: Integer and Double

AP Computer Science A· difficulty 3/5

Integer a = 10;
Integer b = 3;
System.out.println(a / b);

What is printed?

  • A

    3

    check_circle
  • B

    10

  • C

    3.0

  • D

    3.33

Explanation

The Integer values are unboxed to ints; integer division of 10 / 3 truncates to 3.

Want 10 more like this — adaptive to your weak spots?

Related questions