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.

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

  (C) & (D)

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

  (A) & (B)

  (A), (B) & (C)

  Half-n-half Clue
 

2.

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

  (B) & (C)

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

  (A), (B) & (C)

  (A), (C) & (D)

  Half-n-half Clue
 

3.

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

  2

  3

  1

  8

  5

  Half-n-half Clue
 

4.

15 & 29 = ?

  14

  13

  12

  44

  Half-n-half Clue
 

5.

Given the declarations
boolean b;
short x1 = 100, x2 = 200, x3 = 300; Which of the following statements are evaluated to true?
(A) b = x1 * 2 == x2;
(B) b = x1 + x2 != 3 * x1;
(C) b = (x3 - 2*x2<0) || ((x3 = 400)<2**x2);
(D) b = (x3 - 2*x2>0) || ((x3 = 400) 2*x2);

  (A), (B) & (C)

  (B) & (C)

  (A) & (D)

  (A) & (C)

  (A), (C) & (D)

  Half-n-half Clue
 

6.

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

  '\u0001'

  '\uffff'

  " " (space)

  '\u0000'

  Half-n-half Clue
 

7.

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

  (A), (B) & (C)

  (A)

  (C)

  (A) & (B)

  Half-n-half Clue
 


 
12 more pages in Java Programming


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