JAVA Constructors and Methods The implicit return type of a constructor is There is no return type. None of these A class object in which it is defined. void There is no return type. None of these A class object in which it is defined. void ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods class MyClass{int i;int j;public MyClass(int i, int j){this.i = i;this.j = j;}public void call(){System.out.print("One");}}public class Test{public static void main(String args[]){MyClass m = new MyClass(); //line 1m.call(); //line 2}} One Compilation fails due to an error on line 2 Compilation fails due to an error on line 1 Compilation succeed but no output. One Compilation fails due to an error on line 2 Compilation fails due to an error on line 1 Compilation succeed but no output. ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Determine output of the following program.public class Test{ public static void main(String args[]){ System.out.println( Math.floor( Math.random( ) ) ) ; }} 10.0 0.0 1.0 0.5 10.0 0.0 1.0 0.5 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class MyClass{ }For the above class(MyClass) what is the correct way of declaring constructor? MyClass(void) {} public MyClass(void){} 1 and 3 public MyClass(){} MyClass(){} MyClass(void) {} public MyClass(void){} 1 and 3 public MyClass(){} MyClass(){} 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);}} Compile time error as final method can't be overloaded None of these Method 1 Method 2 Compile time error as final method can't be overloaded None of these Method 1 Method 2 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The finalize() method is called just prior to An object or variable goes out of scope. None of these Before garbage collection. An object, variable or method goes out of scope. A variable goes out of scope. An object or variable goes out of scope. None of these Before garbage collection. An object, variable or method goes out of scope. A variable goes out of scope. ANSWER DOWNLOAD EXAMIANS APP