JAVA Constructors and Methods The variables declared in a class for the use of all methods of the class are called reference variables objects instance variables None of these reference variables objects instance variables None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of the modifier can't be used for constructors? private public protected static private public protected static ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What will be the result of compiling and running the given code?class A{ int b=10; private A(){ this.b=7; } int f(){ return b; }}class B extends A{ int b;}public class Test{ public static void main(String[] args){ A a = new B(); System.out.println(a.f()); }} None of these Prints 10 Prints 7 Prints 0 Compilation Fails None of these Prints 10 Prints 7 Prints 0 Compilation Fails 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 Compilation clean but throws RuntimeException long Compilation fails None of these int Compilation clean but throws RuntimeException long Compilation fails None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods class A{ A(String s){} A(){}}1. class B extends A{2. B(){}3. B(String s){4. super(s);5. }6. void test(){7. // insert code here8. }9. }Which of the below code can be insert at line 7 to make clean compilation ? A a = new B(); None of these A a = new A(String s); A a = new B(5); All of these A a = new B(); None of these A a = new A(String s); A a = new B(5); All 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. There is no return type. None of these void A class object in which it is defined. There is no return type. None of these void ANSWER DOWNLOAD EXAMIANS APP