JAVA Constructors and Methods What is Math.floor(3.6)? 3.0 4.0 4 3 3.0 4.0 4 3 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The main method should be static for the reason It can be executed without creating any instance of the class. It can be accessed easily by the class loader. None of these It can be accessed by every method or variable without any hindrance. It can be executed without creating any instance of the class. It can be accessed easily by the class loader. None of these It can be accessed by every method or variable without any hindrance. ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of the modifier can't be used for constructors? protected public private static protected public private static ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods class A{ A(String s){} A(){}}1. class B extends A{2. B(){}3. B(String s){4. super(s);5. }6. void test(){7. // insert code here8. }9. }Which of the below code can be insert at line 7 to make clean compilation ? A a = new B(); None of these A a = new A(String s); All of these A a = new B(5); A a = new B(); None of these A a = new A(String s); All of these A a = new B(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(){} 1 and 3 public MyClass(void){} public MyClass(){} MyClass(void) {} MyClass(){} 1 and 3 public MyClass(void){} public MyClass(){} MyClass(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)); } } The sum of x and y is 45 does not compile None of these The sum of x and y is 9 The sum of x and y is 45 does not compile None of these The sum of x and y is 9 ANSWER DOWNLOAD EXAMIANS APP