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.

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;

  (B) & (C)

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

  (A), (C) & (D)

  (A), (B) & (C)

  (A) & (D)

  Half-n-half Clue
 

2.

What will be the result of the expression
a % b
when a and b are of type int and their values are a = -17 and b = -6?

  5

  -5

  -23

  None of these

  Half-n-half Clue
 

3.

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

  Division by zero
Catch block

  Division by zero

  Error. Won't compile

  Catch block

  Half-n-half Clue
 

4.

15 & 29 = ?

  14

  44

  13

  12

  Half-n-half Clue
 

5.

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

  (A) & (B)

  (A), (B) & (C)

  (C)

  (A)

  Half-n-half Clue
 

6.

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

  (A), (B) & (C)

  (A), (C) & (E)

  (C) & (E)

  (A), (C) & (D)

  (A) & (E)

  Half-n-half Clue
 

7.

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

  3

  2

  5

  8

  1

  Half-n-half Clue
 


 
12 more pages in Java Programming


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