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 volatile static final native abstract volatile static final native 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 with no output. Compiles and runs printing Runtime error It will fail to compile. Compiles and runs with no output. Compiles and runs printing Runtime error It will fail to compile. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control The object is created with new keyword Depends on the code At Compile-time None of these At run-time Depends on the code At Compile-time None of these At run-time 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;}} Hello2 InsideDemo 10 InsideDemo 10 Hello2 Compilation error. InsideDemo 10 Hello2 hello1 IllegalArgumentException is thrown at runtime. Hello2 InsideDemo 10 InsideDemo 10 Hello2 Compilation error. InsideDemo 10 Hello2 hello1 IllegalArgumentException is thrown at runtime. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control A package is a collection of Classes Editing tools Editing tools and Interfaces Classes and Interfaces Interfaces Classes Editing tools Editing tools and Interfaces Classes and Interfaces Interfaces ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output after the following program is compiled and executed?public class Test{ public static void main(String args[]){ int x = 10; x = myMethod(x--); System.out.print(x); } static int myMethod(final int x){ return x--; }} None of these The program will lead to runtime error. The program will compile successfully and display 10 as output. The program will lead to compilation error. The will compile successfully and display 9 as output. None of these The program will lead to runtime error. The program will compile successfully and display 10 as output. The program will lead to compilation error. The will compile successfully and display 9 as output. ANSWER DOWNLOAD EXAMIANS APP