JAVA Constructors and Methods The variables declared in a class for the use of all methods of the class are called None of these objects instance variables reference variables None of these objects instance variables reference variables ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Determine Output:class A{public static void method(int i){System.out.print("Method 1");}public static int method(String str){System.out.print("Method 2");return 0;}}public class Test{ public static void main(String args[]){A.method(5);}} Method 2 None of these Method 1 Compile time error as final method can't be overloaded Method 2 None of these Method 1 Compile time error as final method can't be overloaded ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What will be the result of compiling and running the given code?class A{ int b=10; private A(){ this.b=7; } int f(){ return b; }}class B extends A{ int b;}public class Test{ public static void main(String[] args){ A a = new B(); System.out.println(a.f()); }} Prints 10 None of these Prints 7 Prints 0 Compilation Fails Prints 10 None of these Prints 7 Prints 0 Compilation Fails ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output for the below code?public class Test{ public static void printValue(int i, int j, int k){ System.out.println("int"); } public static void printValue(byte...b){ System.out.println("long"); } public static void main(String... args){ byte b = 9; printValue(b,b,b); }} int long Compilation clean but throws RuntimeException Compilation fails None of these int long Compilation clean but throws RuntimeException Compilation fails None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the expected output?public class Profile { private Profile(int w) { // line 1 System.out.print(w); } public static Profile() { // line 5 System.out.print (10); } public static void main(String args[]) { Profile obj = new Profile(50); }} Won't compile because of line (5), constructor can't be static 10 50 50 Won't compile because of line (1), constructor can't be private Won't compile because of line (5), constructor can't be static 10 50 50 Won't compile because of line (1), constructor can't be private ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? None of these Test( ) public Test(void) Test(void) public Test( ) None of these Test( ) public Test(void) Test(void) public Test( ) ANSWER DOWNLOAD EXAMIANS APP