Declaration and Access Control The object is created with new keyword At run-time None of these At Compile-time Depends on the code At run-time None of these At Compile-time Depends on the code ANSWER DOWNLOAD EXAMIANS APP
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;}} IllegalArgumentException is thrown at runtime. InsideDemo 10 Hello2 hello1 InsideDemo 10 Hello2 Compilation error. Hello2 InsideDemo 10 IllegalArgumentException is thrown at runtime. InsideDemo 10 Hello2 hello1 InsideDemo 10 Hello2 Compilation error. Hello2 InsideDemo 10 ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output for the below code?static public class Test{ public static void main(String[] args){ char c = 'a'; switch(c){ case 65 : System.out.println("one");break; case 'a': System.out.println("two");break; case 3 : System.out.println("three"); } }} None of these Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. two one Compile error - char can't be permitted in switch statement. None of these Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. two one Compile error - char can't be permitted in switch statement. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What can directly access and change the value of the variable qusNo?package com.mypackage;public class Test{ private int qusNo = 100;} Only the Test class. Any class in com.mypackage package. Any class that extends Test. Any class. None of these Only the Test class. Any class in com.mypackage package. Any class that extends Test. Any class. None of these ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output?public class Test{static{int a = 5;}public static void main(String args[]){new Test().call();}void call(){this.a++;System.out.print(this.a);}} Compile with error 0 Runtime Exception 6 5 Compile with error 0 Runtime Exception 6 5 ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control You have the following code in a file called Test.javaclass Base{ public static void main(String[] args){ System.out.println("Hello"); }}public class Test extends Base{}What will happen if you try to compile and run this? Compiles and runs printing Runtime error Compiles and runs with no output. It will fail to compile. Compiles and runs printing Runtime error Compiles and runs with no output. It will fail to compile. ANSWER DOWNLOAD EXAMIANS APP