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 2.0 0 None of these Compile time error 2.0 0 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( ) ) ) ; }} 0.5 1.0 0.0 10.0 0.5 1.0 0.0 10.0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? public Test(void) None of these public Test( ) Test(void) Test( ) public Test(void) None of these public Test( ) Test(void) Test( ) 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 Compile fail due to error on line no 8 Compile fail due to error on line no 9 None of these 15 Compile fail due to error on line no 2 Compile fail due to error on line no 8 Compile fail due to error on line no 9 None of these 15 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of the modifier can't be used for constructors? private public protected static private public protected static ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the expected output?class Animal {Animal() {System.out.println("Animal");}}class Wild extends Animal{Wild() {System.out.println("Wild");super();}}public class Test {public static void main(String args[]) {Wild wild = new Wild();}} Animal Wild Runtime Exception Compilation Error Wild Animal Animal Wild Runtime Exception Compilation Error Wild Animal ANSWER DOWNLOAD EXAMIANS APP