Integer x = 7;
Integer y = 4;
int r = x.compareTo(y);What is the sign of r?
- Acheck_circle
positive
- B
undefined
- C
negative
- D
zero
Explanation
7 > 4, so compareTo returns a positive value.
AP Computer Science A· difficulty 2/5
Integer x = 7;
Integer y = 4;
int r = x.compareTo(y);What is the sign of r?
positive
undefined
negative
zero
Explanation
7 > 4, so compareTo returns a positive value.
Want 10 more like this — adaptive to your weak spots?