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 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)); } } does not compile None of these The sum of x and y is 45 The sum of x and y is 9 does not compile None of these The sum of x and y is 45 The sum of x and y is 9 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output for the below code?public class Test{ public static void printValue(int i, int j, int k){ System.out.println("int"); } public static void printValue(byte...b){ System.out.println("long"); } public static void main(String... args){ byte b = 9; printValue(b,b,b); }} None of these Compilation fails int Compilation clean but throws RuntimeException long None of these Compilation fails int Compilation clean but throws RuntimeException long 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(void) throws IOException{} void examians() {} throws IOException void examians() throws IOException{} void examians() throw IOException{} examians() throws IOException{} void examians(void) throws IOException{} void examians() {} throws IOException void examians() throws IOException{} void examians() throw IOException{} examians() throws IOException{} 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 class MyClass{int i;int j;public MyClass(int i, int j){this.i = i;this.j = j;}public void call(){System.out.print("One");}}public class Test{public static void main(String args[]){MyClass m = new MyClass(); //line 1m.call(); //line 2}} Compilation succeed but no output. Compilation fails due to an error on line 1 Compilation fails due to an error on line 2 One Compilation succeed but no output. Compilation fails due to an error on line 1 Compilation fails due to an error on line 2 One ANSWER DOWNLOAD EXAMIANS APP