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);}} Method 1 None of these Compile time error as final method can't be overloaded Method 2 Method 1 None of these Compile time error as final method can't be overloaded Method 2 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods class MyClass{ MyClass(){ System.out.print("one"); } public void myMethod(){ this(); System.out.print("two"); }} public class TestClass{ public static void main(String args[]){ MyClass obj = new MyClass(); obj.myMethod(); }} Compilation Error two one one one Exception None of these one one two Compilation Error two one one one Exception None of these one one two 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 void int double None of these void int double 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? Stack Storage Area Array Heap Stack Storage Area Array Heap 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 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 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The following code contains one compilation error, find it?public class Test {Test() { } // line 1static void Test() { this(); } // line 2 public static void main(String[] args) { // line 3Test(); // line 4}} At line 4 At line 3, compilation error, ambiguity problem, compiler can't determine whether a constructor At line 2, constructor call At line 1, constructor Tester must be marked public like its class At line 4 At line 3, compilation error, ambiguity problem, compiler can't determine whether a constructor At line 2, constructor call At line 1, constructor Tester must be marked public like its class ANSWER DOWNLOAD EXAMIANS APP