Declaration and Access Control The object is created with new keyword Depends on the code At run-time None of these At Compile-time Depends on the code At run-time None of these At Compile-time 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. static native abstract final volatile static native abstract final volatile 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 one two Compile error - char can't be permitted in switch statement. Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. None of these one two Compile error - char can't be permitted in switch statement. Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output?public class Test{static{int a = 5;}public static void main(String args[]){new Test().call();}void call(){this.a++;System.out.print(this.a);}} Runtime Exception Compile with error 6 5 0 Runtime Exception Compile with error 6 5 0 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;} None of these Any class in com.mypackage package. Any class that extends Test. Any class. Only the Test class. None of these Any class in com.mypackage package. Any class that extends Test. Any class. Only the Test class. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control Consider the following two classes declared and defined in two different packages, what can be added in class B to form what considered a correct access to class A from main() method of class B?package subPackage;public class A { }package anotherPackage;// line 1public class B{public static void main(String[] args){// line 2}}1. At line1 add noting; At line2 add: new A();2. At line 1 add: import package.*; at line 2 add : new subPackage.A();3. At line 1 add: import subPackage.*; at line 2 add : new A();4. At line 1 add: import subPackage.A; at line 2 add : new A(); 1 and 3 2 and 4 3 and 4 1 and 2 1 and 3 2 and 4 3 and 4 1 and 2 ANSWER DOWNLOAD EXAMIANS APP