Java Programming Questions and Answers
Showing 11 -
13 of
13 questions
11
Which of the following statements are valid array declaration? (A) int number(); (B) float average[]; (C) double[] marks; (D) counter int[];
12
Which of the following will output a random with values only from 1 to 10?
a
System.out.println(Math.round(Math.random()* 10));
b
System.out.println(Math.round(Math.random() % 10));
c
System.out.println(Math.random() *10);
13
Which of the following will compile correctly?
a
System.out.println(Math.max(x));
b
System.out.println(Math.random(10,3));
c
System.out.println(Math.round(20));
d
System.out.println(Math.sqrt(10));