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 {
	 static int i = 0;

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

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

Program will give error : illigal start of expression at "static final int i=0;"

REPLY :
static final int i=0;

again only final is permitted.