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.

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

  None of these

  1.66

  4

  Half-n-half Clue
 

2.

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

  (A) & (B)

  (C)

  (A)

  (A), (B) & (C)

  Half-n-half Clue
 

3.

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

  3

  2

  5

  1

  8

  Half-n-half Clue
 

4.

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 = 3, y = 2, z = 6

  x = 4, y = 1, z = 5

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

  x = 4, y = 2, z = 6

  Half-n-half Clue
 

5.

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

  34

  23

  57

  11

  Error. Cannot be executed.

  Half-n-half Clue
 

6.

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

  (C)

  (A)

  (D) & (E)

  (C) & (E)

  (A), (C) & (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 = -17 and b = -6?

  None of these

  5

  -5

  -23

  Half-n-half Clue
 


 
12 more pages in Java Programming


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