Java.lang Class

Q1:
public class Myfile 
{ 
    public static void main (String[] args) 
    {
        String biz = args[1]; 
        String baz = args[2]; 
        String rip = args[3]; 
        System.out.println('Arg is ' + rip); 
    } 
}
Select how you would start the program to cause it to print: Arg is 2

A java Myfile 222

B java Myfile 1 2 2 3 4

C java Myfile 1 3 2 2

D java Myfile 0 1 2 3

Q2:
Which of the following are valid calls to Math.max?
  1. Math.max(1,4)
  2. Math.max(2.3, 5)
  3. Math.max(1, 3, 5, 7)
  4. Math.max(-1.5, -2.8f)

A 1, 2 and 4

B 2, 3 and 4

C 1, 2 and 3

D 3 and 4

Q3: What is the value of 'd' after this line of code has been executed? double d = Math.round ( 2.5 + Math.random() );

A 2

B 3

C 4

D 2.5

Q4: Which of the following would compile without error?

A int a = Math.abs(-5);

B int b = Math.abs(5.0);

C int c = Math.abs(5.5F);

D int d = Math.abs(5L);


img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.