Syvum Home Page

Home > Quiz Games > Java Programming >

Java Programming : Basic Operations : Multiple Choice


Answer the following questions about basic operations in the Java programming language.

Formats Info Page Worksheet / Test Paper Quiz Review
Multiple choice

Your Performance  

1.

Consider the following code snippet:
.....
.....
try

  Division by zero
Catch block

  Division by zero

  Catch block

  Error. Won't compile

  Half-n-half Clue
 

2.

Of the following functions from the class java.lang.Math, select those that produce a value of 25, when a = 25.7.

  (A)

  (C) & (E)

  (D) & (E)

  (A), (C) & (E)

  (C)

  Half-n-half Clue
 

3.

Which of the following represent legal flow control statements?
(A) break;
(B) break();
(C) continue outer;
(D) continue(inner);
(E) return;
(F) exit();

  (A), (C) & (D)

  (C) & (E)

  (A), (C) & (E)

  (A) & (E)

  (A), (B) & (C)

  Half-n-half Clue
 

4.

Identify the statements that are correct:
(A) int a = 13, a>>2 = 3
(B) int b = -8, b>>1 = -4
(C) int a = 13, a>>>2 = 3
(D) int b = -8, b>>>1 = -4

  (A), (B) & (C)

  (A) & (B)

  (C) & (D)

  (A), (B), (C) & (D)

  Half-n-half Clue
 

5.

Choose the operations that can be performed on String objects:
(A) +
(B) + =
(C) -
(D) %
(E) ^

  (A) & (B)

  (D) & (E)

  None of these

  (D)/option>

  (A)

  Half-n-half Clue
 

6.

In which of the following code fragments, is the variable x evaluated to 8?
(A) int x = 32;
x = x>>2;
(B) int x = 33;
x = x>>2;
(C) int x = 35;
x = x>>2;
(D) int x = 16;
x = x>>1;

  (A), (B), (C) & (D)

  (A), (C) & (D)

  (A) & (D)

  (A), (B) & (C)

  (B) & (C)

  Half-n-half Clue
 

7.

The type long can be used to store values in the following range:

  -264 to 264

  -232 to 232 - 1

  -263 to 263 - 1

  -231 to 231 - 1

  Half-n-half Clue
 


 
12 more pages in Java Programming


Contact Info © 1999-2020 Syvum Technologies Inc. Privacy Policy Disclaimer and Copyright
Previous
-
Next
-