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 20 one two 20 one 20 one one two 20 one two 20 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 block A A block static A None of these static A static block A A block static A None of these static A ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output?public class Test{ public static void main(String[] args){ String value = "abc"; changeValue(value); System.out.println(value); } public static void changeValue(String a){ a = "xyz"; }} Compilation fails abc Compilation clean but no output xyz None of these Compilation fails abc Compilation clean but no output xyz None of these ANSWER DOWNLOAD EXAMIANS APP
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. final static volatile native abstract final static volatile native abstract 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); }} Compile with error None of these 0 Runtime Exception 5 Compile with error None of these 0 Runtime Exception 5 ANSWER DOWNLOAD EXAMIANS APP