Home / MCQ Bank / Computer
Computer Declaration And Access Control

Determine 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; } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • InsideDemo 10 Hello2

Related Computer Questions

The name given to a document by the user is called Which of the following is a property of likelihood? If several elements are competing for the same bucket in the hash table, what is it called? What is the worst case analysis of Shell sort using Sedgewick's increments? How can you extract a group from a matched regular expression in Python?