JAVA Constructors and Methods The variables declared in a class for the use of all methods of the class are called objects instance variables None of these reference variables objects instance variables None of these reference variables ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? None of these public Test(void) Test(void) public Test( ) Test( ) None of these public Test(void) Test(void) public Test( ) Test( ) 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 None of these 2 3 1 Compilation Error None of these 2 3 1 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The finalize() method is called just prior to An object, variable or method goes out of scope. None of these Before garbage collection. A variable goes out of scope. An object or variable goes out of scope. An object, variable or method goes out of scope. None of these Before garbage collection. A variable goes out of scope. An object or variable goes out of scope. 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(void) throws IOException{} void examians() {} throws IOException void examians() throws IOException{} void examians() throw IOException{} examians() throws IOException{} void examians(void) throws IOException{} void examians() {} throws IOException void examians() throws IOException{} void examians() throw IOException{} examians() throws IOException{} ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output for the below code?public class Test{ public static void printValue(int i, int j, int k){ System.out.println("int"); } public static void printValue(byte...b){ System.out.println("long"); } public static void main(String... args){ byte b = 9; printValue(b,b,b); }} int None of these Compilation fails Compilation clean but throws RuntimeException long int None of these Compilation fails Compilation clean but throws RuntimeException long ANSWER DOWNLOAD EXAMIANS APP