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.

15 & 29 = ?

  14

  12

  13

  44

  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.

  (D) & (E)

  (C) & (E)

  (A)

  (A), (C) & (E)

  (C)

  Half-n-half Clue
 

3.

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

  Division by zero

  Error. Won't compile

  Division by zero
Catch block

  Catch block

  Half-n-half Clue
 

4.

27 | 8 = ?

  27

  19

  8

  35

  Half-n-half Clue
 

5.

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

  (B) & (C)

  (A) & (D)

  (A), (B) & (C)

  Half-n-half Clue
 

6.

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

  4

  None of these

  1

  1.66

  Half-n-half Clue
 

7.

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

  5

  8

  3

  1

  2

  Half-n-half Clue
 


 
12 more pages in Java Programming


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