JAVA Constructors and Methods Determine output of the following program.public class Test{ public static void main(String args[]){ System.out.println( Math.floor( Math.random( ) ) ) ; }} 1.0 0.5 10.0 0.0 1.0 0.5 10.0 0.0 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++; }} Compilation Error 2 1 3 None of these Compilation Error 2 1 3 None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the expected output?class Animal {Animal() {System.out.println("Animal");}}class Wild extends Animal{Wild() {System.out.println("Wild");super();}}public class Test {public static void main(String args[]) {Wild wild = new Wild();}} Animal Wild Wild Animal Runtime Exception Compilation Error Animal Wild Wild Animal Runtime Exception Compilation Error 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() {} throws IOException void examians(void) throws IOException{} void examians() throws IOException{} examians() throws IOException{} void examians() throw IOException{} void examians() {} throws IOException void examians(void) throws IOException{} void examians() throws IOException{} examians() throws IOException{} void examians() throw IOException{} ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Determine Output:class A{public static void method(int i){System.out.print("Method 1");}public static int method(String str){System.out.print("Method 2");return 0;}}public class Test{ public static void main(String args[]){A.method(5);}} Method 1 None of these Method 2 Compile time error as final method can't be overloaded Method 1 None of these Method 2 Compile time error as final method can't be overloaded ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is Math.floor(3.6)? 4.0 3.0 4 3 4.0 3.0 4 3 ANSWER DOWNLOAD EXAMIANS APP