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 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{} void examians(void) throws IOException{} 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(); None of these A a = new A(String s); A a = new B(5); All of these A a = new B(); None of these A a = new A(String s); A a = new B(5); 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 clean but throws RuntimeException long Compilation fails int None of these Compilation clean but throws RuntimeException long Compilation fails int 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 None of these reference variables instance variables objects None of these reference variables instance variables objects ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The implicit return type of a constructor is There is no return type. void None of these A class object in which it is defined. There is no return type. void None of these A class object in which it is defined. 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 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 ANSWER DOWNLOAD EXAMIANS APP