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);}} Compile time error as final method can't be overloaded Method 2 None of these Method 1 Compile time error as final method can't be overloaded Method 2 None of these Method 1 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()); }} Prints 0 None of these Prints 10 Prints 7 Compilation Fails Prints 0 None of these Prints 10 Prints 7 Compilation Fails ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output for the below code ?1. public class A{2. int add(int i, int j){3. return i+j;4. }5. }6. public class B extends A{7. public static void main(String argv[]){8. short s = 9;9. System.out.println(add(s,6));10. }11.} Compile fail due to error on line no 2 None of these Compile fail due to error on line no 9 15 Compile fail due to error on line no 8 Compile fail due to error on line no 2 None of these Compile fail due to error on line no 9 15 Compile fail due to error on line no 8 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of the modifier can't be used for constructors? private protected static public private protected static public ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is Math.floor(3.6)? 4.0 3 4 3.0 4.0 3 4 3.0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of these is a legal definition of a method named examveda assuming it throws IOException, and returns void. Also assume that the method does not take any arguments. Select the one correct answer. void examians() {} throws IOException void examians(void) throws IOException{} void examians() throws IOException{} void examians() throw IOException{} examians() throws IOException{} void examians() {} throws IOException void examians(void) throws IOException{} void examians() throws IOException{} void examians() throw IOException{} examians() throws IOException{} ANSWER DOWNLOAD EXAMIANS APP