JAVA Constructors and Methods The variables declared in a class for the use of all methods of the class are called instance variables objects reference variables None of these instance variables objects reference variables None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of the modifier can't be used for constructors? private protected public static private protected public static 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)); } } does not compile The sum of x and y is 45 None of these The sum of x and y is 9 does not compile The sum of x and y is 45 None of these The sum of x and y is 9 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? Heap Array Storage Area Stack Heap Array Storage Area Stack ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Determine output:public class Test{ public static void main(String args[]){ MyClass obj = new MyClass(); obj.val = 1; obj.call(obj); System.out.println(obj.val); }}class MyClass{ public int val; public void call(MyClass ref){ ref.val++; }} 3 None of these Compilation Error 1 2 3 None of these Compilation Error 1 2 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