Declaration and Access Control The object is created with new keyword At run-time At Compile-time Depends on the code None of these At run-time At Compile-time Depends on the code None of these ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output for the below code?public class Test{ static{ int a = 5; } public static void main(String[] args){ System.out.println(a); }} None of these 0 Compile with error Runtime Exception 5 None of these 0 Compile with error Runtime Exception 5 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);}} 0 Compile with error 5 Runtime Exception 6 0 Compile with error 5 Runtime Exception 6 ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control A package is a collection of Editing tools and Interfaces Classes Interfaces Classes and Interfaces Editing tools Editing tools and Interfaces Classes Interfaces Classes and Interfaces Editing tools 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? It will fail to compile. Compiles and runs printing Compiles and runs with no output. Runtime error It will fail to compile. Compiles and runs printing Compiles and runs with no output. Runtime error ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control Choose the correct statement. Restriction on static methods are: I. They can only call other static methods.II. They must only access static data.III. They cannot refer this or super in any way. Only (III) (I) and (II) Only (I) (I), (II) and (III) (II) and (III) Only (III) (I) and (II) Only (I) (I), (II) and (III) (II) and (III) ANSWER DOWNLOAD EXAMIANS APP