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.

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

  8

  1

  5

  2

  3

  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?

  None of these

  -23

  -5

  5

  Half-n-half Clue
 

3.

27 | 8 = ?

  19

  27

  35

  8

  Half-n-half Clue
 

4.

Of the following functions from the class java.lang.Math, select those that produce a value of 25, when a = 25.7.

  (A)

  (A), (C) & (E)

  (D) & (E)

  (C) & (E)

  (C)

  Half-n-half Clue
 

5.

Choose the operations that can be performed on String objects:
(A) +
(B) + =
(C) -
(D) %
(E) ^

  None of these

  (A)

  (D)/option>

  (D) & (E)

  (A) & (B)

  Half-n-half Clue
 

6.

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

  (A) & (D)

  (A), (C) & (D)

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

  (B) & (C)

  Half-n-half Clue
 

7.

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

  -231 to 231 - 1

  -263 to 263 - 1

  -264 to 264

  -232 to 232 - 1

  Half-n-half Clue
 


 
12 more pages in Java Programming


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