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.

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

  (A) & (B)

  (A), (B) & (C)

  (C)

  (A)

  Half-n-half Clue
 

2.

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

  11

  Error. Cannot be executed.

  34

  57

  23

  Half-n-half Clue
 

3.

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?

  -5

  None of these

  5

  -23

  Half-n-half Clue
 

4.

Identify the statements that are correct:
(A) int a = 13, a>>2 = 3
(B) int b = -8, b>>1 = -4
(C) int a = 13, a>>>2 = 3
(D) int b = -8, b>>>1 = -4

  (A) & (B)

  (A), (B) & (C)

  (C) & (D)

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

  Half-n-half Clue
 

5.

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

  (D)/option>

  (A)

  (D) & (E)

  (A) & (B)

  None of these

  Half-n-half Clue
 

6.

27 | 8 = ?

  19

  27

  8

  35

  Half-n-half Clue
 

7.

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

  (A) & (C)

  (A), (C) & (D)

  (A) & (D)

  (A), (B) & (C)

  (B) & (C)

  Half-n-half Clue
 


 
12 more pages in Java Programming


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