JAVA Constructors and Methods The main method should be static for the reason None of these It can be accessed by every method or variable without any hindrance. It can be executed without creating any instance of the class. It can be accessed easily by the class loader. None of these It can be accessed by every method or variable without any hindrance. It can be executed without creating any instance of the class. It can be accessed easily by the class loader. 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() (int)(Math.random() + 0.5) (int)Math.random() + 1 (int)(Math.random() + 0.2) (int)Math.random() (int)(Math.random() + 0.5) (int)Math.random() + 1 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What will be the return type of a method that not returns any value? int None of these void double int None of these void double ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is Math.floor(3.6)? 3.0 3 4.0 4 3.0 3 4.0 4 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 ) ; } } Compile time error None of these 0 2.0 Compile time error None of these 0 2.0 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() {} throws IOException examians() throws IOException{} void examians() throws IOException{} void examians() throw IOException{} void examians(void) throws IOException{} void examians() {} throws IOException examians() throws IOException{} void examians() throws IOException{} void examians() throw IOException{} void examians(void) throws IOException{} ANSWER DOWNLOAD EXAMIANS APP