What happens after you compile and run this code?

public class MyClass{
    static int i;
    public static void main(String[] args){
        System.out.println(i);
    }
}
Explanation
All numerical class fields are initialized to zero by default.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback