Single Choice Not Set

QDetermine output:
public class InitDemo{
	static int i = demo();
	static{
                System.out.print(i);
        }
	InitDemo(){
		System.out.print("hello1");
	}
	public static void main(String... args){
                System.out.print("Hello2");
	}
 	static int demo(){
        	System.out.print("InsideDemo");
		return 10;
	}
}

ID: #2106 Declaration and Access Control in Java 806 views
Question Info
#2106Q ID
Not SetDifficulty
Declaration and Access Control in JavaTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Compilation error.
  • B IllegalArgumentException is thrown at runtime.
  • C InsideDemo 10 Hello2
  • D Hello2 InsideDemo 10
Correct Answer

Explanation

InsideDemo 10 Hello2

Share This Question

Challenge a friend or share with your study group.

Related MCQ Questions