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 in com.mypackage package. Any class. Any class that extends Test. None of these Only the Test class. Any class in com.mypackage package. Any class. Any class that extends Test. None of these Only the Test class. ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output after the following program is compiled and executed?public class Test{ public static void main(String args[]){ int x = 10; x = myMethod(x--); System.out.print(x); } static int myMethod(final int x){ return x--; }} The program will compile successfully and display 10 as output. The program will lead to compilation error. None of these The program will lead to runtime error. The will compile successfully and display 9 as output. The program will compile successfully and display 10 as output. The program will lead to compilation error. None of these The program will lead to runtime error. The will compile successfully and display 9 as output. 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. native static final volatile abstract native static final volatile abstract 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"; }} xyz Compilation fails None of these Compilation clean but no output abc xyz Compilation fails None of these Compilation clean but no output abc ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control A package is a collection of Classes and Interfaces Editing tools Classes Editing tools and Interfaces Interfaces Classes and Interfaces Editing tools Classes Editing tools and Interfaces 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(); }} None of these static block A A block static A static A None of these static block A A block static A static A ANSWER DOWNLOAD EXAMIANS APP