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.

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)

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

  (D) & (F)

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

  (B), (C) & (D)

  Half-n-half Clue
 

2.

Which of the following represent legal flow control statements?
(A) break;
(B) break();
(C) continue outer;
(D) continue(inner);
(E) return;
(F) exit();

  (C) & (E)

  (A) & (E)

  (A), (B) & (C)

  (A), (C) & (E)

  (A), (C) & (D)

  Half-n-half Clue
 

3.

15 & 29 = ?

  13

  14

  12

  44

  Half-n-half Clue
 

4.

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

  Division by zero
Catch block

  Error. Won't compile

  Division by zero

  Catch block

  Half-n-half Clue
 

5.

Given the declarations
int x , m = 2000;
short y;
byte b1 = -40, b2;
long n;
Which of the following assignment statements will evaluate correctly?
(A) x = m * b1;
(B) y = m * b1;
(C) n = m * 3L;
(D) x = m * 3L;

  (A), (C) & (D)

  (A), (B) & (C)

  (A) & (D)

  (A) & (C)

  (B) & (C)

  Half-n-half Clue
 

6.

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 = -7, y = 1, z = 5

  x = 3, y = 2, z = 6

  x = 4, y = 2, z = 6

  x = 4, y = 1, z = 5

  Half-n-half Clue
 

7.

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

  (A) & (B)

  (C)

  (A), (B) & (C)

  (A)

  Half-n-half Clue
 


 
12 more pages in Java Programming


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