JAVA Constructors and Methods The implicit return type of a constructor is 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. There is no return type. void None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Determine output:public class Test{ public static void main(String args[]){ MyClass obj = new MyClass(); obj.val = 1; obj.call(obj); System.out.println(obj.val); }}class MyClass{ public int val; public void call(MyClass ref){ ref.val++; }} 1 2 Compilation Error None of these 3 1 2 Compilation Error None of these 3 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output for the below code ?class A{ public A(){ System.out.println("A"); } public A(int i){ this(); System.out.println(i); }}class B extends A{ public B(){ System.out.println("B"); } public B(int i){ this(); System.out.println(i+3); }}public class Test{ public static void main (String[] args){ new B(5); }} A B 5 None of these B 8 A 5 A B 8 A 5 B 8 A B 5 None of these B 8 A 5 A B 8 A 5 B 8 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the expected output?public class Profile {private Profile(int w) { // line 1System.out.print(w);}public final Profile() { // line 5System.out.print(10);}public static void main(String args[]) {Profile obj = new Profile(50);}} 10 50 50 Won't compile because of line (1); constructor can't be private Won't compile because of line (5); constructor can't be final 10 50 50 Won't compile because of line (1); constructor can't be private Won't compile because of line (5); constructor can't be final ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is Math.floor(3.6)? 4 3 4.0 3.0 4 3 4.0 3.0 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() throw IOException{} examians() throws IOException{} void examians() throws IOException{} void examians(void) throws IOException{} void examians() {} throws IOException void examians() throw IOException{} examians() throws IOException{} void examians() throws IOException{} void examians(void) throws IOException{} void examians() {} throws IOException ANSWER DOWNLOAD EXAMIANS APP