JAVA Constructors and Methods In which area of memory, the system stores parameters and local variables whenever a method is invoked? Heap Array Storage Area Stack Heap Array Storage Area Stack 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 ? None of these A a = new A(String s); All of these A a = new B(); A a = new B(5); None of these A a = new A(String s); All of these A a = new B(); A a = new B(5); 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 main method should be static for the reason It can be accessed easily by the class loader. None of these It can be accessed by every method or variable without any hindrance. It can be executed without creating any instance of the class. It can be accessed easily by the class loader. None of these It can be accessed by every method or variable without any hindrance. It can be executed without creating any instance of the class. ANSWER DOWNLOAD EXAMIANS APP
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 ) ; } } 0 None of these Compile time error 2.0 0 None of these Compile time error 2.0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class MyClass{ }For the above class(MyClass) what is the correct way of declaring constructor? MyClass(void) {} MyClass(){} public MyClass(){} 1 and 3 public MyClass(void){} MyClass(void) {} MyClass(){} public MyClass(){} 1 and 3 public MyClass(void){} ANSWER DOWNLOAD EXAMIANS APP