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. (I) and (II) Only (III) (II) and (III) (I), (II) and (III) Only (I) (I) and (II) Only (III) (II) and (III) (I), (II) and (III) Only (I) ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control Which statements are most accurate regarding the following classes?class A{ private int i; protected int j;}class B extends A{ private int k; protected int m;} An object of B contains data fields k, m. An object of B contains data fields j, m. An object of B contains data fields i, j, k, m. An object of B contains data fields j, k, m. An object of B contains data fields k, m. An object of B contains data fields j, m. An object of B contains data fields i, j, k, m. An object of B contains data fields j, k, m. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What is the output for the below code ?public class A{ static{ System.out.println("static"); } { System.out.println("block"); } public A(){ System.out.println("A"); } public static void main(String[] args){ A a = new A(); }} A static A static block A A block static None of these A static A static block A A block static None of these 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 4 (invalid argument type for method main ) Compile error at line 2 (constructors can't be static) Compile error at line 3 (static methods can't invoke this) Compile error at line 1 (static x must be only accessed inside static methods) 44 Compile error at line 4 (invalid argument type for method main ) Compile error at line 2 (constructors can't be static) Compile error at line 3 (static methods can't invoke this) Compile error at line 1 (static x must be only accessed inside static methods) 44 ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control A package is a collection of Editing tools Interfaces Editing tools and Interfaces Classes and Interfaces Classes Editing tools Interfaces Editing tools and Interfaces Classes and Interfaces Classes 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 Exception is thrown at runtime Derived Compilation Error BaseDerived Exception is thrown at runtime Derived Compilation Error ANSWER DOWNLOAD EXAMIANS APP