Multiple choice technology web technology

What will be output of following code?public class Main { public static void main(String[] args) { int i; i = i + 5; System.out.println(i); }}

  1. Compile time error

  2. 5

  3. 0

  4. None of above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Local variables in Java must be initialized before use. Variable i is declared but never assigned a value before i = i + 5 attempts to read it. This violates Java's definite assignment rules, causing compile-time error.