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( ) ) ) ; }} 0.5 10.0 0.0 1.0 0.5 10.0 0.0 1.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? MyClass(void) {} MyClass(){} public MyClass(){} 1 and 3 public MyClass(void){} MyClass(void) {} MyClass(){} public MyClass(){} 1 and 3 public MyClass(void){} ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What will be the return type of a method that not returns any value? None of these double int void None of these double int void ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The implicit return type of a constructor is void A class object in which it is defined. There is no return type. None of these void A class object in which it is defined. There is no return type. None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the expected output?class Animal {Animal() {System.out.println("Animal");}}class Wild extends Animal{Wild() {System.out.println("Wild");super();}}public class Test {public static void main(String args[]) {Wild wild = new Wild();}} Animal Wild Compilation Error Runtime Exception Wild Animal Animal Wild Compilation Error Runtime Exception Wild Animal 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}} Compilation fails due to an error on line 1 Compilation fails due to an error on line 2 Compilation succeed but no output. One Compilation fails due to an error on line 1 Compilation fails due to an error on line 2 Compilation succeed but no output. One ANSWER DOWNLOAD EXAMIANS APP