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.

27 | 8 = ?

  35

  27

  19

  8

  Half-n-half Clue
 

2.

Consider the following code: int x, y, z;
y = 1;
z = 5;
x = 0 - (++y) + z++;

After execution of this, what will be the values of x, y and z?

  x = 4, y = 2, z = 6

  x = 3, y = 2, z = 6

  x = 4, y = 1, z = 5

  x = -7, y = 1, z = 5

  Half-n-half Clue
 

3.

What will be the value of a after execution of the following statements:
int a = 23, b = 34;
a = ((a < b) ? (b + a) : (b - a);

  57

  34

  Error. Cannot be executed.

  23

  11

  Half-n-half Clue
 

4.

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

  5

  8

  1

  3

  2

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

  (A) & (B)

  (A)

  (C)

  Half-n-half Clue
 

6.

In the code below, what data types the variable x can have?
byte b1 = 5;
byte b2 = 10;
x = b1 * b2;(A) byte
(B) int
(C) short
(D) long
(E) float
(F) double

  (B), (D), (E) & (F)

  (D) & (F)

  (B), (C) & (D)

  (B), (D) & (E)

  (A), (B), (D) & (E)

  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 = 10 and b = 6?

  1

  4

  1.66

  None of these

  Half-n-half Clue
 


 
12 more pages in Java Programming


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