JAVA Constructors and Methods Which of the modifier can't be used for constructors? public static private protected public static private protected ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output of the program?class Test{ public int display(int x, int y){ return ("The sum of x and y is " + x + y); } public static void main(String args[]){ Test test = new Test(); System.out.println(test.display(4,5)); } } The sum of x and y is 9 The sum of x and y is 45 None of these does not compile The sum of x and y is 9 The sum of x and y is 45 None of these does not compile 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 The variables declared in a class for the use of all methods of the class are called reference variables objects None of these instance variables reference variables objects None of these instance variables 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(); }} two one one one Exception one one two Compilation Error None of these two one one one Exception one one two Compilation Error None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods In which area of memory, the system stores parameters and local variables whenever a method is invoked? Storage Area Stack Heap Array Storage Area Stack Heap Array ANSWER DOWNLOAD EXAMIANS APP