Declaration and Access Control What can directly access and change the value of the variable qusNo?package com.mypackage;public class Test{ private int qusNo = 100;} None of these Only the Test class. Any class that extends Test. Any class. Any class in com.mypackage package. None of these Only the Test class. Any class that extends Test. Any class. Any class in com.mypackage package. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output for the below code?static public class Test{ public static void main(String[] args){ char c = 'a'; switch(c){ case 65 : System.out.println("one");break; case 'a': System.out.println("two");break; case 3 : System.out.println("three"); } }} None of these two one Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. Compile error - char can't be permitted in switch statement. None of these two one Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. Compile error - char can't be permitted in switch statement. 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 clean but no output xyz None of these Compilation fails abc Compilation clean but no output xyz None of these Compilation fails abc ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control A package is a collection of Classes Interfaces Classes and Interfaces Editing tools and Interfaces Editing tools Classes Interfaces Classes and Interfaces Editing tools and Interfaces Editing tools 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 two one 20 20 one one two 20 one two one 20 20 one one two 20 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(); }} Compilation Error BaseDerived Derived Exception is thrown at runtime Compilation Error BaseDerived Derived Exception is thrown at runtime ANSWER DOWNLOAD EXAMIANS APP