JAVA Constructors and Methods In which area of memory, the system stores parameters and local variables whenever a method is invoked? Heap Storage Area Array Stack Heap Storage Area Array Stack ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? Test(void) public Test(void) None of these public Test( ) Test( ) Test(void) public Test(void) None of these public Test( ) Test( ) 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 None of these Prints 0 Prints 10 Prints 7 Compilation Fails None of these Prints 0 Prints 10 Prints 7 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 reference variables None of these instance variables objects reference variables None of these 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? 5 0 0 0 0 8 5 8 5 0 0 0 0 8 5 8 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of these is a legal definition of a method named examveda assuming it throws IOException, and returns void. Also assume that the method does not take any arguments. Select the one correct answer. void examians() throws IOException{} examians() throws IOException{} void examians() {} throws IOException void examians(void) throws IOException{} void examians() throw IOException{} void examians() throws IOException{} examians() throws IOException{} void examians() {} throws IOException void examians(void) throws IOException{} void examians() throw IOException{} ANSWER DOWNLOAD EXAMIANS APP