JAVA Constructors and Methods In which area of memory, the system stores parameters and local variables whenever a method is invoked? Storage Area Heap Array Stack Storage Area Heap Array Stack 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 objects reference variables instance variables None of these objects reference variables instance variables None of these 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++; }} None of these 2 Compilation Error 3 1 None of these 2 Compilation Error 3 1 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 Compilation Error Wild Animal Runtime Exception Animal Wild Compilation Error Wild Animal Runtime Exception ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class MyClass{ }For the above class(MyClass) what is the correct way of declaring constructor? 1 and 3 public MyClass(void){} public MyClass(){} MyClass(){} MyClass(void) {} 1 and 3 public MyClass(void){} public MyClass(){} MyClass(){} MyClass(void) {} 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(); }} Compilation Error two one one one Exception one one two None of these Compilation Error two one one one Exception one one two None of these ANSWER DOWNLOAD EXAMIANS APP