Declaration and Access Control A package is a collection of Classes Editing tools Interfaces Classes and Interfaces Editing tools and Interfaces Classes Editing tools Interfaces Classes and Interfaces Editing tools and Interfaces 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 static A None of these A static block A A block static static A None of these A ANSWER DOWNLOAD EXAMIANS APP
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. Any class. None of these Only the Test class. Any class in com.mypackage package. Any class that extends Test. Any class. None of these Only the Test class. Any class in com.mypackage package. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control The object is created with new keyword None of these Depends on the code At run-time At Compile-time None of these Depends on the code At run-time At Compile-time 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? Compiles and runs printing Runtime error It will fail to compile. Compiles and runs with no output. Compiles and runs printing Runtime error It will fail to compile. Compiles and runs with no output. 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"); } }} two one Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. None of these Compile error - char can't be permitted in switch statement. two one Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. None of these Compile error - char can't be permitted in switch statement. ANSWER DOWNLOAD EXAMIANS APP