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 int i=0; i = 10; System.out.println(i); } }

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 int i=0; i = 10; System.out.println(i); } }

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

By:Jalees
Date:2016-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher