Expressions and Assignment Statements

AP Computer Science A· difficulty 4/5

char c = 'A';
int n = c + 1;
System.out.println(n);

What is printed?

  • A

    65

  • B

    A1

  • C

    66

    check_circle
  • D

    B

Explanation

'A' has Unicode value 65; adding 1 promotes it to int 66, which is printed as the integer 66.

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

Related questions