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.

If not assigned a value, a variable of type char has the following default value:

  " " (space)

  '\u0000'

  '\u0001'

  '\uffff'

  Half-n-half Clue
 

2.

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

  (D)/option>

  (A)

  (A) & (B)

  (D) & (E)

  None of these

  Half-n-half Clue
 

3.

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
 

4.

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

  (C) & (E)

  (C)

  (A), (C) & (E)

  (D) & (E)

  (A)

  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;

  (B) & (C)

  (A), (C) & (D)

  (A) & (D)

  (A) & (C)

  (A), (B) & (C)

  Half-n-half Clue
 

6.

Select the invalid assignment statements from the following:
(A) float x = 238.88;
(B) double y = 0x443;

  (A) & (C)

  (A) & (B)

  (B) & (D)

  (B)

  Half-n-half Clue
 

7.

15 & 29 = ?

  13

  12

  44

  14

  Half-n-half Clue
 


 
12 more pages in Java Programming


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