boolean b = true;
System.out.println(!b);What is printed?
- Acheck_circle
false
- B
true
- C
!true
- D
1
Explanation
The ! operator negates a boolean value. !true evaluates to false.
AP Computer Science A· difficulty 1/5
boolean b = true;
System.out.println(!b);What is printed?
false
true
!true
1
Explanation
The ! operator negates a boolean value. !true evaluates to false.
Want 10 more like this — adaptive to your weak spots?