Declaration and Access Control The object is created with new keyword Depends on the code None of these At run-time At Compile-time Depends on the code None of these At run-time At Compile-time ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control A package is a collection of Editing tools and Interfaces Classes Editing tools Interfaces Classes and Interfaces Editing tools and Interfaces Classes Editing tools Interfaces Classes and Interfaces ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What is the result of compiling and running the following code?public class Tester{static int x = 4;public Tester(){System.out.print(this.x); // line 1Tester();}public static void Tester(){ // line 2System.out.print(this.x); // line 3}public static void main(String... args){ // line 4new Tester();}} Compile error at line 2 (constructors can't be static) 44 Compile error at line 3 (static methods can't invoke this) Compile error at line 4 (invalid argument type for method main ) Compile error at line 1 (static x must be only accessed inside static methods) Compile error at line 2 (constructors can't be static) 44 Compile error at line 3 (static methods can't invoke this) Compile error at line 4 (invalid argument type for method main ) Compile error at line 1 (static x must be only accessed inside static methods) 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"); } }} one None of these Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. two Compile error - char can't be permitted in switch statement. one None of these Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. two Compile error - char can't be permitted in switch statement. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output?public class Test{ public static void main(String[] args){ String value = "abc"; changeValue(value); System.out.println(value); } public static void changeValue(String a){ a = "xyz"; }} xyz None of these abc Compilation clean but no output Compilation fails xyz None of these abc Compilation clean but no output Compilation fails ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output after compiling and running following program code?public class Test{ static int a; public static void main(String[] args){ System.out.println("one"); call(1); } static void call(int a){ this.a=10; System.out.println("two "+a); }} one two 0 Compile time error. one two 1 None of these one two 10 one two 0 Compile time error. one two 1 None of these one two 10 ANSWER DOWNLOAD EXAMIANS APP