int a = 5, b = 9;
a = b;
b = a;What are a and b after?
- A
a=5, b=9
- Bcheck_circle
a=9, b=9
- C
a=9, b=5
- D
a=5, b=5
Explanation
Without a temporary, a's original value is lost; both end up equal to 9.
AP Computer Science A· difficulty 2/5
int a = 5, b = 9;
a = b;
b = a;What are a and b after?
a=5, b=9
a=9, b=9
a=9, b=5
a=5, b=5
Explanation
Without a temporary, a's original value is lost; both end up equal to 9.
Want 10 more like this — adaptive to your weak spots?