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() + 0.5)
(int)Math.random()
(int)Math.random() + 1

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); }}

Compilation fails
Compilation clean but throws RuntimeException
None of these
long
int

ANSWER DOWNLOAD EXAMIANS APP