<code>final int x = 5; x = 10;</code> causes
- Acheck_circle
Compile error (cannot reassign final)
- B
Throws exception
- C
Compiles fine
- D
x = 10 silently
Explanation
<code>final</code> variables can only be assigned once.
AP Computer Science A· difficulty 4/5
<code>final int x = 5; x = 10;</code> causes
Compile error (cannot reassign final)
Throws exception
Compiles fine
x = 10 silently
Explanation
<code>final</code> variables can only be assigned once.
Want 10 more like this — adaptive to your weak spots?