JAVA Constructors and Methods The variables declared in a class for the use of all methods of the class are called reference variables objects None of these instance variables reference variables objects None of these instance variables ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? Test( ) None of these public Test( ) Test(void) public Test(void) Test( ) None of these public Test( ) Test(void) public Test(void) ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The finalize() method is called just prior to Before garbage collection. A variable goes out of scope. An object, variable or method goes out of scope. None of these An object or variable goes out of scope. Before garbage collection. A variable goes out of scope. An object, variable or method goes out of scope. None of these An object or variable goes out of scope. ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the expected output?public class Profile { private Profile(int w) { // line 1 System.out.print(w); } public static Profile() { // line 5 System.out.print (10); } public static void main(String args[]) { Profile obj = new Profile(50); }} 50 Won't compile because of line (1), constructor can't be private 10 50 Won't compile because of line (5), constructor can't be static 50 Won't compile because of line (1), constructor can't be private 10 50 Won't compile because of line (5), constructor can't be static ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The main method should be static for the reason It can be accessed by every method or variable without any hindrance. It can be accessed easily by the class loader. It can be executed without creating any instance of the class. None of these It can be accessed by every method or variable without any hindrance. It can be accessed easily by the class loader. It can be executed without creating any instance of the class. None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of the modifier can't be used for constructors? private protected static public private protected static public ANSWER DOWNLOAD EXAMIANS APP