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;} Any class that extends Test. None of these Any class in com.mypackage package. Only the Test class. Any class. Any class that extends Test. None of these Any class in com.mypackage package. Only the Test class. Any class. 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 will compile, but we cannot create an object of Circle with a specified radius. The object will always have radius 0. The program has a compilation error because it does not have a main method. The program does not compile because Circle does not have a default constructor. 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 has a compilation error because it does not have a main method. The program does not compile because Circle does not have a default constructor. The program has a compilation error because we cannot assign radius to radius. 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) (I), (II) and (III) Only (III) (I) and (II) Only (I) (II) and (III) (I), (II) and (III) Only (III) (I) and (II) Only (I) 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); }} 0 None of these Compile with error 5 Runtime Exception 0 None of these Compile with error 5 Runtime Exception 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. Runtime error Compiles and runs printing Compiles and runs with no output. It will fail to compile. Runtime error Compiles and runs printing Compiles and runs with no output. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control The object is created with new keyword Depends on the code At run-time At Compile-time None of these Depends on the code At run-time At Compile-time None of these ANSWER DOWNLOAD EXAMIANS APP