JAVA Constructors and Methods Which of the modifier can't be used for constructors? private protected public static private protected public static 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 fails long None of these Compilation clean but throws RuntimeException int Compilation fails long None of these Compilation clean but throws RuntimeException ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class MyClass{ }For the above class(MyClass) what is the correct way of declaring constructor? public MyClass(void){} 1 and 3 public MyClass(){} MyClass(){} MyClass(void) {} public MyClass(void){} 1 and 3 public MyClass(){} MyClass(){} MyClass(void) {} ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Which of the following options is the best for generating random integer 0 or 1? (int)(Math.random() + 0.2) (int)Math.random() + 1 (int)(Math.random() + 0.5) (int)Math.random() (int)(Math.random() + 0.2) (int)Math.random() + 1 (int)(Math.random() + 0.5) (int)Math.random() ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods The variables declared in a class for the use of all methods of the class are called reference variables instance variables objects None of these reference variables instance variables objects None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? None of these Test( ) public Test(void) public Test( ) Test(void) None of these Test( ) public Test(void) public Test( ) Test(void) ANSWER DOWNLOAD EXAMIANS APP