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:

  -263 to 263 - 1

  -264 to 264

  -231 to 231 - 1

  -232 to 232 - 1

  Half-n-half Clue
 

2.

Which of the following is not a hexadecimal number?
(A) 999
(B) (hex)23
(C) 0x556
(D) 0x1F2

  (A) & (B)

  (C)

  (A), (B) & (C)

  (A)

  Half-n-half Clue
 

3.

Given the declarations
int x , m = 2000;
short y;
byte b1 = -40, b2;
long n;
Which of the following assignment statements will evaluate correctly?
(A) x = m * b1;
(B) y = m * b1;
(C) n = m * 3L;
(D) x = m * 3L;

  (B) & (C)

  (A) & (C)

  (A), (B) & (C)

  (A) & (D)

  (A), (C) & (D)

  Half-n-half Clue
 

4.

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

  1

  3

  8

  5

  2

  Half-n-half Clue
 

5.

27 | 8 = ?

  27

  19

  35

  8

  Half-n-half Clue
 

6.

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

  Error. Won't compile

  Catch block

  Division by zero
Catch block

  Division by zero

  Half-n-half Clue
 

7.

Select the invalid assignment statements from the following:
(A) float x = 238.88;
(B) double y = 0x443;

  (A) & (B)

  (B)

  (A) & (C)

  (B) & (D)

  Half-n-half Clue
 


 
12 more pages in Java Programming


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