JAVA Constructors and Methods In which area of memory, the system stores parameters and local variables whenever a method is invoked? Array Heap Stack Storage Area Array Heap Stack Storage Area ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What will be the result of compiling and running the given code?class A{ int b=10; private A(){ this.b=7; } int f(){ return b; }}class B extends A{ int b;}public class Test{ public static void main(String[] args){ A a = new B(); System.out.println(a.f()); }} Compilation Fails Prints 7 None of these Prints 10 Prints 0 Compilation Fails Prints 7 None of these Prints 10 Prints 0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The implicit return type of a constructor is A class object in which it is defined. void None of these There is no return type. A class object in which it is defined. void None of these There is no return type. 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(); }} one one two Compilation Error one Exception two one one None of these one one two Compilation Error one Exception two one one None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the expected output?public class Profile { private Profile(int w) { // line 1 System.out.print(w); } public static Profile() { // line 5 System.out.print (10); } public static void main(String args[]) { Profile obj = new Profile(50); }} 50 Won't compile because of line (5), constructor can't be static 10 50 Won't compile because of line (1), constructor can't be private 50 Won't compile because of line (5), constructor can't be static 10 50 Won't compile because of line (1), constructor can't be private 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 objects None of these reference variables instance variables objects None of these reference variables ANSWER DOWNLOAD EXAMIANS APP