JAVA Constructors and Methods What will be the return type of a method that not returns any value? double int None of these void double int None of these void 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 9 None of these The sum of x and y is 45 does not compile The sum of x and y is 9 None of these The sum of x and y is 45 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? Test( ) public Test( ) public Test(void) Test(void) None of these Test( ) public Test( ) public Test(void) Test(void) None of these 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.5 1.0 0.0 10.0 0.5 1.0 0.0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Given the following piece of code:class Person{ public int number;}public class Test{ public void doIt(int i , Person p){ i = 5; p.number = 8; } public static void main(String args[]){ int x = 0; Person p = new Person(); new Test().doIt(x, p); System.out.println(x + " " + p.number); }}What is the result? 5 0 0 8 0 0 5 8 5 0 0 8 0 0 5 8 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 ) ; } } Compile time error 0 2.0 None of these Compile time error 0 2.0 None of these ANSWER DOWNLOAD EXAMIANS APP