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.

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

  -231 to 231 - 1

  -232 to 232 - 1

  -264 to 264

  -263 to 263 - 1

  Half-n-half Clue
 

2.

(1 | 4) + (4 & 2) = ?
(in base ten)

  3

  8

  2

  5

  1

  Half-n-half Clue
 

3.

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), (C) & (D)

  (A) & (D)

  (B) & (C)

  (A), (B) & (C)

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

  Half-n-half Clue
 

4.

If not assigned a value, a variable of type char has the following default value:

  '\u0000'

  " " (space)

  '\u0001'

  '\uffff'

  Half-n-half Clue
 

5.

15 & 29 = ?

  12

  14

  44

  13

  Half-n-half Clue
 

6.

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

  Division by zero

  Division by zero
Catch block

  Error. Won't compile

  Catch block

  Half-n-half Clue
 

7.

In the code below, what data types the variable x can have?
byte b1 = 5;
byte b2 = 10;
x = b1 * b2;(A) byte
(B) int
(C) short
(D) long
(E) float
(F) double

  (D) & (F)

  (B), (D) & (E)

  (B), (C) & (D)

  (B), (D), (E) & (F)

  (A), (B), (D) & (E)

  Half-n-half Clue
 


 
12 more pages in Java Programming


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