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.0 10.0 1.0 0.5 0.0 10.0 1.0 0.5 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
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 Method 2 None of these Method 1 Compile time error as final method can't be overloaded Method 2 None of these Method 1 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output of the program?class Test{ public int display(int x, int y){ return ("The sum of x and y is " + x + y); } public static void main(String args[]){ Test test = new Test(); System.out.println(test.display(4,5)); } } does not compile None of these The sum of x and y is 45 The sum of x and y is 9 does not compile None of these The sum of x and y is 45 The sum of x and y is 9 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The implicit return type of a constructor is There is no return type. A class object in which it is defined. void None of these There is no return type. A class object in which it is defined. void None of these ANSWER DOWNLOAD EXAMIANS APP