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 = ?

  44

  12

  13

  14

  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)

  (A), (C) & (E)

  (A)

  (C)

  (C) & (E)

  Half-n-half Clue
 

3.

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);

  (B) & (C)

  (A) & (D)

  (A), (B) & (C)

  (A) & (C)

  (A), (C) & (D)

  Half-n-half Clue
 

4.

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

  (A), (C) & (D)

  (A), (C) & (E)

  (C) & (E)

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

  (B) & (C)

  (A), (C) & (D)

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

  (A), (B) & (C)

  Half-n-half Clue
 

6.

27 | 8 = ?

  35

  8

  27

  19

  Half-n-half Clue
 

7.

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

  -5

  -23

  5

  Half-n-half Clue
 


 
12 more pages in Java Programming


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