Question PRG-JAVA-0008
EasyWhat is the default value of an int field (instance variable) in Java?
- A.
1
- B.
0
- C.
Show answer and explanation
Answer: B
Fields get defaults (0, false, null). Local variables have no default and must be assigned before use.