Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

What is output of following code


package r4r.co.in.core.java;

public class HelloWorld {
	 int i = 0;

	public static void main(String args[]) {
	
		System.out.println(i);
		new HelloWorld();
		
		
	}

	static {
	static int i;
		i = 10;
		System.out.println(i);
	}
}

The above program give an error in compilation, illigal start of expression at static int i in the static initialization block.