JAVA Constructors and Methods The implicit return type of a constructor is A class object in which it is defined. There is no return type. void None of these A class object in which it is defined. There is no return type. void None of these 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(5); A a = new B(); None of these All of these A a = new A(String s); A a = new B(5); A a = new B(); None of these All of these A a = new A(String s); 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 one two two one one one Exception None of these Compilation Error one one two two one one one Exception None of these Compilation Error 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( ) ) ) ; }} 10.0 0.5 1.0 0.0 10.0 0.5 1.0 0.0 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();}} Wild Animal Compilation Error Animal Wild Runtime Exception Wild Animal Compilation Error Animal Wild Runtime Exception ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? Test( ) None of these Test(void) public Test(void) public Test( ) Test( ) None of these Test(void) public Test(void) public Test( ) ANSWER DOWNLOAD EXAMIANS APP