JAVA Constructors and Methods In which area of memory, the system stores parameters and local variables whenever a method is invoked? Heap Array Storage Area Stack Heap Array Storage Area Stack 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{} examians() throws IOException{} void examians() throws IOException{} void examians() throw IOException{} void examians() {} throws IOException void examians(void) throws IOException{} examians() throws IOException{} void examians() throws IOException{} void examians() throw IOException{} void examians() {} throws IOException ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods class A{ A(String s){} A(){}}1. class B extends A{2. B(){}3. B(String s){4. super(s);5. }6. void test(){7. // insert code here8. }9. }Which of the below code can be insert at line 7 to make clean compilation ? All of these A a = new B(5); A a = new A(String s); A a = new B(); None of these All of these A a = new B(5); A a = new A(String s); A a = new B(); None of these 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 The sum of x and y is 9 None of these does not compile The sum of x and y is 45 The sum of x and y is 9 None of these does not compile ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What will be the return type of a method that not returns any value? double None of these void int double None of these void int ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class MyClass{ }For the above class(MyClass) what is the correct way of declaring constructor? MyClass(void) {} 1 and 3 MyClass(){} public MyClass(){} public MyClass(void){} MyClass(void) {} 1 and 3 MyClass(){} public MyClass(){} public MyClass(void){} ANSWER DOWNLOAD EXAMIANS APP