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);}} None of these Method 2 Compile time error as final method can't be overloaded Method 1 None of these Method 2 Compile time error as final method can't be overloaded Method 1 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output for the below code?public class Test{ public static void printValue(int i, int j, int k){ System.out.println("int"); } public static void printValue(byte...b){ System.out.println("long"); } public static void main(String... args){ byte b = 9; printValue(b,b,b); }} long Compilation clean but throws RuntimeException Compilation fails int None of these long Compilation clean but throws RuntimeException Compilation fails int 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( ) ) ) ; }} 1.0 10.0 0.5 0.0 1.0 10.0 0.5 0.0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The variables declared in a class for the use of all methods of the class are called instance variables None of these reference variables objects instance variables None of these reference variables objects ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The implicit return type of a constructor is None of these A class object in which it is defined. void There is no return type. None of these A class object in which it is defined. void There is no return type. 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(); }} one Exception two one one Compilation Error None of these one one two one Exception two one one Compilation Error None of these one one two ANSWER DOWNLOAD EXAMIANS APP