JAVA Constructors and Methods What is Math.floor(3.6)? 4.0 3 4 3.0 4.0 3 4 3.0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class MyClass{ }For the above class(MyClass) what is the correct way of declaring constructor? public MyClass(){} MyClass(void) {} 1 and 3 public MyClass(void){} MyClass(){} public MyClass(){} MyClass(void) {} 1 and 3 public MyClass(void){} MyClass(){} ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The finalize() method is called just prior to An object, variable or method goes out of scope. Before garbage collection. None of these An object or variable goes out of scope. A variable goes out of scope. An object, variable or method goes out of scope. Before garbage collection. None of these An object or variable goes out of scope. A variable goes out of scope. ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The main method should be static for the reason It can be accessed easily by the class loader. It can be accessed by every method or variable without any hindrance. None of these It can be executed without creating any instance of the class. It can be accessed easily by the class loader. It can be accessed by every method or variable without any hindrance. None of these It can be executed without creating any instance of the class. ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods class MyClass{ MyClass(){ System.out.print("one"); } public void myMethod(){ this(); System.out.print("two"); }} public class TestClass{ public static void main(String args[]){ MyClass obj = new MyClass(); obj.myMethod(); }} Compilation Error one Exception None of these two one one one one two Compilation Error one Exception None of these two one one one one two ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output of the above program ?class Num { Num(double x ){ System.out.println( x ) ; } }public class Test extends Num { public static void main(String[] args){ Num num = new Num( 2 ) ; } } 2.0 0 Compile time error None of these 2.0 0 Compile time error None of these ANSWER DOWNLOAD EXAMIANS APP