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. static volatile native final abstract static volatile native final abstract 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. (II) and (III) Only (III) Only (I) (I), (II) and (III) (I) and (II) (II) and (III) Only (III) Only (I) (I), (II) and (III) (I) and (II) 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?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(); }} Exception is thrown at runtime Derived Compilation Error BaseDerived Exception is thrown at runtime Derived Compilation Error BaseDerived ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control A package is a collection of Editing tools Editing tools and Interfaces Classes and Interfaces Interfaces Classes Editing tools Editing tools and Interfaces Classes and Interfaces Interfaces Classes 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);}} Runtime Exception 0 6 5 Compile with error Runtime Exception 0 6 5 Compile with error ANSWER DOWNLOAD EXAMIANS APP