JAVA Constructors and Methods The variables declared in a class for the use of all methods of the class are called instance variables None of these objects reference variables instance variables None of these objects reference variables 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); }} Won't compile because of line (1), constructor can't be private 10 50 50 Won't compile because of line (5), constructor can't be static Won't compile because of line (1), constructor can't be private 10 50 50 Won't compile because of line (5), constructor can't be static ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output of the program?class Test{ public int display(int x, int y){ return ("The sum of x and y is " + x + y); } public static void main(String args[]){ Test test = new Test(); System.out.println(test.display(4,5)); } } The sum of x and y is 9 does not compile None of these The sum of x and y is 45 The sum of x and y is 9 does not compile None of these The sum of x and y is 45 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The finalize() method is called just prior to An object or variable goes out of scope. A variable goes out of scope. Before garbage collection. None of these An object, variable or method goes out of scope. An object or variable goes out of scope. A variable goes out of scope. Before garbage collection. None of these An object, variable or method goes out of scope. ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output of the above program ?class Num { Num(double x ){ System.out.println( x ) ; } }public class Test extends Num { public static void main(String[] args){ Num num = new Num( 2 ) ; } } 2.0 None of these 0 Compile time error 2.0 None of these 0 Compile time error ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What will be the return type of a method that not returns any value? double None of these void int double None of these void int ANSWER DOWNLOAD EXAMIANS APP