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 native final volatile static abstract native final volatile static ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output after compiling and running following program code?public class Test{ static int a; public static void main(String[] args){ System.out.println("one"); call(1); } static void call(int a){ this.a=10; System.out.println("two "+a); }} Compile time error. one two 1 one two 10 None of these one two 0 Compile time error. one two 1 one two 10 None of these one two 0 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(); }} static A A None of these A block static static block A static A A None of these A block static static block A 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 j, k, m. An object of B contains data fields i, 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 j, k, m. An object of B contains data fields i, j, k, m. An object of B contains data fields k, m. An object of B contains data fields j, m. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control The object is created with new keyword Depends on the code At Compile-time At run-time None of these Depends on the code At Compile-time At run-time None of these ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control Determine Output:class MyClass{ static final int a = 20; static final void call(){ System.out.println("two"); } static{ System.out.println("one"); }}public class Test{ public static void main(String args[]){ System.out.println(MyClass.a); }} one 20 one one two one two 20 20 one 20 one one two one two 20 20 ANSWER DOWNLOAD EXAMIANS APP