Page 316 - CA_Blue( J )_Class9
P. 316
(viii) Double a=4 is a error.
(a) Syntax (b) Runtime
(c) Logical (d) Type
Ans. (a) Syntax
(ix) import java.util.*; used for importing .
(a) InputStreamReader class (b) Scanner class
(c) Logical Error (d) Java database connectivity classes
Ans. (b) Scanner class
(x) Which of the following methods are already defined in the Java compiler?
(a) User defined (b) Library
(c) Both a and b (d) None of these
Ans. (b) Library
(xi) Which type of value does Math.max(double, int) return?
(a) int (b) float
(c) double (d) none of these
Ans. (c) double
(xii) Which statement is used to exit from switch case?
(a) continue (b) break
(c) System.exit(-1) (d) return
Ans. (b) break
(xiii) If break is not used with switch case, then .
(a) It is a syntax error.
(b) Normal flow of control.
(c) It is Fall Through situation.
(d) It is a Logical Error.
Ans. (c) It is Fall Through situation.
(xiv) Which loop contains initialisation, condition for testing and increment or decrement in the same line?
(a) for (b) while
(c) do while (d) None of these
Ans. (a) for
(xv) Which loop ends with a semicolon (;)?
(a) for (b) while
(c) do-while (d) all of these
Ans. (c) do-while
(xvi) for(i=1;i>=0;i++)
{
System.out.println("Loop");
}
It is a/an .
(a) finite loop (b) infinite loop
(c) Null loop (d) body less loop
Ans. (b) infinite loop
(xvii) Assertion(A): Programs written in a high-level language can be translated into machine language.
Reason(R): High-level language is user friendly.
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A).
(c) Assertion (A) is true and Reason (R) is false.
(d) Assertion (A) is false and Reason (R) is true.
Ans. (b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A).
314 Touchpad Computer Applications-IX

