JAVA Constructors and Methods What is Math.floor(3.6)? 3.0 4 4.0 3 3.0 4 4.0 3 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The finalize() method is called just prior to Before garbage collection. None of these An object, variable or method goes out of scope. An object or variable goes out of scope. A variable goes out of scope. Before garbage collection. None of these An object, variable or method goes out of scope. An object or variable goes out of scope. A variable goes out of scope. 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); }} Compilation fails None of these long Compilation clean but throws RuntimeException int Compilation fails None of these long Compilation clean but throws RuntimeException int ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The implicit return type of a constructor is void None of these A class object in which it is defined. There is no return type. void None of these A class object in which it is defined. There is no return type. 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 7 Prints 0 Prints 10 Compilation Fails None of these Prints 7 Prints 0 Prints 10 Compilation Fails None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Determine output:public class Test{ public static void main(String args[]){ MyClass obj = new MyClass(); obj.val = 1; obj.call(obj); System.out.println(obj.val); }}class MyClass{ public int val; public void call(MyClass ref){ ref.val++; }} Compilation Error 1 3 2 None of these Compilation Error 1 3 2 None of these ANSWER DOWNLOAD EXAMIANS APP