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 volatile final abstract native static volatile final abstract native 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. (I), (II) and (III) Only (I) Only (III) (II) and (III) (I) and (II) (I), (II) and (III) Only (I) Only (III) (II) and (III) (I) and (II) 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 20 one two 20 one one two 20 one 20 one two 20 one 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. Only the Test class. Any class in com.mypackage package. None of these Any class that extends Test. Any class. Only the Test class. Any class in com.mypackage package. None of these Any class that extends Test. 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 5 Compile with error Runtime Exception None of these 0 5 Compile with error Runtime Exception None of these ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control A package is a collection of Editing tools Interfaces Classes and Interfaces Editing tools and Interfaces Classes Editing tools Interfaces Classes and Interfaces Editing tools and Interfaces Classes ANSWER DOWNLOAD EXAMIANS APP