int a = 5;
int b = a;
a = 10;
System.out.println(b);What is printed?
- Acheck_circle
5
- B
10
- C
0
- D
15
Explanation
Primitive assignment copies the value; b stores 5 independently of a, so changing a does not affect b.
AP Computer Science A· difficulty 4/5
int a = 5;
int b = a;
a = 10;
System.out.println(b);What is printed?
5
10
0
15
Explanation
Primitive assignment copies the value; b stores 5 independently of a, so changing a does not affect b.
Want 10 more like this — adaptive to your weak spots?