Declaration and Access Control The object is created with new keyword At Compile-time At run-time None of these Depends on the code At Compile-time At run-time None of these Depends on the code 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); }} None of these Runtime Exception 0 5 Compile with error None of these Runtime Exception 0 5 Compile with error ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control What will be the output after compiling and running following program code?public class Test{ static int a; public static void main(String[] args){ System.out.println("one"); call(1); } static void call(int a){ this.a=10; System.out.println("two "+a); }} None of these Compile time error. one two 0 one two 10 one two 1 None of these Compile time error. one two 0 one two 10 one two 1 ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control Suppose a class has public visibility. In this class we define a protected method. Which of the following statements is correct? From within protected methods you do not have access to public methods. In a class, you cannot declare methods with a lower visibility than the visibility of the class in which it is defined. This method is only accessible from inside the class itself and from inside all subclasses. This method is accessible from within the class itself and from within all classes defined in the same package as the class itself. From within protected methods you do not have access to public methods. In a class, you cannot declare methods with a lower visibility than the visibility of the class in which it is defined. This method is only accessible from inside the class itself and from inside all subclasses. This method is accessible from within the class itself and from within all classes defined in the same package as the class itself. 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);}} 5 Compile with error Runtime Exception 6 0 5 Compile with error Runtime Exception 6 0 ANSWER DOWNLOAD EXAMIANS APP
Declaration and Access Control A package is a collection of Classes and Interfaces Editing tools and Interfaces Editing tools Interfaces Classes Classes and Interfaces Editing tools and Interfaces Editing tools Interfaces Classes ANSWER DOWNLOAD EXAMIANS APP