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 Any class that extends Test. Any class in com.mypackage package. Only the Test class. Any class. None of these Any class that extends Test. Any class in com.mypackage package. Only the Test class. Any class. 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 20 one one 20 one two 20 one two 20 one one 20 one two 20 ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control You have the following code in a file called Test.javaclass Base{ public static void main(String[] args){ System.out.println("Hello"); }}public class Test extends Base{}What will happen if you try to compile and run this? It will fail to compile. Compiles and runs printing Compiles and runs with no output. Runtime error It will fail to compile. Compiles and runs printing Compiles and runs with no output. Runtime error 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 volatile abstract native static final volatile abstract native static ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control Choose the correct statementpublic class Circle{ private double radius; public Circle(double radius){ radius = radius; }} The program has a compilation error because we cannot assign radius to radius. The program will compile, but we cannot create an object of Circle with a specified radius. The object will always have radius 0. The program does not compile because Circle does not have a default constructor. The program has a compilation error because it does not have a main method. The program has a compilation error because we cannot assign radius to radius. The program will compile, but we cannot create an object of Circle with a specified radius. The object will always have radius 0. The program does not compile because Circle does not have a default constructor. The program has a compilation error because it does not have a main method. 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(); }} Derived Compilation Error BaseDerived Exception is thrown at runtime Derived Compilation Error BaseDerived Exception is thrown at runtime ANSWER DOWNLOAD EXAMIANS APP