JAVA Constructors and Methods In which area of memory, the system stores parameters and local variables whenever a method is invoked? Storage Area Array Heap Stack Storage Area Array Heap Stack ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of the following options is the best for generating random integer 0 or 1? (int)Math.random() + 1 (int)Math.random() (int)(Math.random() + 0.2) (int)(Math.random() + 0.5) (int)Math.random() + 1 (int)Math.random() (int)(Math.random() + 0.2) (int)(Math.random() + 0.5) ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? Test(void) public Test( ) None of these Test( ) public Test(void) Test(void) public Test( ) None of these Test( ) public Test(void) ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The finalize() method is called just prior to An object or variable goes out of scope. An object, variable or method goes out of scope. None of these A variable goes out of scope. Before garbage collection. An object or variable goes out of scope. An object, variable or method goes out of scope. None of these A variable goes out of scope. Before garbage collection. 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)); } } The sum of x and y is 45 None of these does not compile The sum of x and y is 9 The sum of x and y is 45 None of these does not compile The sum of x and y is 9 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 0 8 5 8 0 0 5 0 0 8 5 8 ANSWER DOWNLOAD EXAMIANS APP