JAVA Constructors and Methods What is Math.floor(3.6)? 4 4.0 3 3.0 4 4.0 3 3.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++; }} 3 1 Compilation Error 2 None of these 3 1 Compilation Error 2 None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? Test(void) public Test(void) Test( ) None of these public Test( ) Test(void) public Test(void) Test( ) None of these public Test( ) ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Given the following piece of code:class Person{ public int number;}public class Test{ public void doIt(int i , Person p){ i = 5; p.number = 8; } public static void main(String args[]){ int x = 0; Person p = new Person(); new Test().doIt(x, p); System.out.println(x + " " + p.number); }}What is the result? 5 8 0 0 0 8 5 0 5 8 0 0 0 8 5 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() {} throws IOException void examians() throws IOException{} void examians(void) throws IOException{} examians() throws IOException{} void examians() throw IOException{} void examians() {} throws IOException void examians() throws IOException{} void examians(void) throws IOException{} examians() throws IOException{} void examians() throw IOException{} ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What will be the return type of a method that not returns any value? int double void None of these int double void None of these ANSWER DOWNLOAD EXAMIANS APP