JAVA Constructors and Methods In which area of memory, the system stores parameters and local variables whenever a method is invoked? Stack Heap Storage Area Array Stack Heap Storage Area Array ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The finalize() method is called just prior to Before garbage collection. An object or variable goes out of scope. None of these An object, variable or method goes out of scope. A variable goes out of scope. Before garbage collection. An object or variable goes out of scope. None of these An object, variable or method goes out of scope. A variable goes out of scope. 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 None of these one one two one Exception Compilation Error two one one None of these one one two one Exception Compilation Error ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Determine Output:class A{public static void method(int i){System.out.print("Method 1");}public static int method(String str){System.out.print("Method 2");return 0;}}public class Test{ public static void main(String args[]){A.method(5);}} None of these Method 2 Method 1 Compile time error as final method can't be overloaded None of these Method 2 Method 1 Compile time error as final method can't be overloaded 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++; }} 1 2 None of these 3 Compilation Error 1 2 None of these 3 Compilation Error ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Given the following piece of code:class Person{ public int number;}public class Test{ public void doIt(int i , Person p){ i = 5; p.number = 8; } public static void main(String args[]){ int x = 0; Person p = new Person(); new Test().doIt(x, p); System.out.println(x + " " + p.number); }}What is the result? 0 0 5 0 5 8 0 8 0 0 5 0 5 8 0 8 ANSWER DOWNLOAD EXAMIANS APP