JAVA Constructors and Methods What will be the return type of a method that not returns any value? int None of these void double int None of these void double 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? 0 8 0 0 5 0 5 8 0 8 0 0 5 0 5 8 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? Test(void) public Test( ) public Test(void) Test( ) None of these Test(void) public Test( ) public Test(void) Test( ) None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The implicit return type of a constructor is A class object in which it is defined. None of these There is no return type. void A class object in which it is defined. None of these There is no return type. void ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The following code contains one compilation error, find it?public class Test {Test() { } // line 1static void Test() { this(); } // line 2 public static void main(String[] args) { // line 3Test(); // line 4}} At line 4 At line 1, constructor Tester must be marked public like its class At line 2, constructor call At line 3, compilation error, ambiguity problem, compiler can't determine whether a constructor At line 4 At line 1, constructor Tester must be marked public like its class At line 2, constructor call At line 3, compilation error, ambiguity problem, compiler can't determine whether a constructor ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The main method should be static for the reason It can be executed without creating any instance of the class. It can be accessed easily by the class loader. None of these It can be accessed by every method or variable without any hindrance. It can be executed without creating any instance of the class. It can be accessed easily by the class loader. None of these It can be accessed by every method or variable without any hindrance. ANSWER DOWNLOAD EXAMIANS APP