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 0.0 1.0 10.0 0.5 0.0 1.0 10.0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods In which area of memory, the system stores parameters and local variables whenever a method is invoked? Storage Area Stack Heap Array Storage Area Stack Heap Array ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of the modifier can't be used for constructors? private protected public static private protected public static 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()); }} None of these Prints 7 Compilation Fails Prints 10 Prints 0 None of these Prints 7 Compilation Fails Prints 10 Prints 0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of the following options is the best for generating random integer 0 or 1? (int)Math.random() (int)Math.random() + 1 (int)(Math.random() + 0.2) (int)(Math.random() + 0.5) (int)Math.random() (int)Math.random() + 1 (int)(Math.random() + 0.2) (int)(Math.random() + 0.5) 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 The sum of x and y is 45 None of these The sum of x and y is 9 does not compile The sum of x and y is 45 None of these The sum of x and y is 9 ANSWER DOWNLOAD EXAMIANS APP