Declaration and Access Control Name the keyword that makes a variable belong to a class, rather than being defined for each instance of the class. abstract static final native volatile abstract static final native volatile ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What is the result of compiling and running the following code?class Base{ private Base(){ System.out.print("Base"); }}public class test extends Base{ public test(){ System.out.print("Derived"); } public static void main(String[] args){ new test(); }} BaseDerived Derived Compilation Error Exception is thrown at runtime BaseDerived Derived Compilation Error Exception is thrown at runtime ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control Choose all the lines which if inserted independently instead of "//insert code here" will allow the following code to compile:public class Test{ public static void main(String args[]){ add(); add(1);add(1, 2); }// insert code here} static void add(int[]... args){} static void add(int args...){} static void add(int... args, int y){} void add(Integer... args){} static void add(int...args){} static void add(int[]... args){} static void add(int args...){} static void add(int... args, int y){} void add(Integer... args){} static void add(int...args){} 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 The object is created with new keyword None of these At Compile-time At run-time Depends on the code None of these At Compile-time At run-time Depends on the code 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 two Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. Compile error - char can't be permitted in switch statement. None of these one two Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. Compile error - char can't be permitted in switch statement. None of these ANSWER DOWNLOAD EXAMIANS APP