# Programming Java Operators

Answer each question, once completed click submit.

1. Which of the following can be operands of arithmetic operators?

Numeric | Boolean | Characters | Both Numeric & Characters |

Workspace

2. Modulus operator, %, can be applied to which of these?

Integers | Floating – point numbers | Both Integers and floating – point numbers. | None of the mentioned |

Workspace

3. With x = 0, which of the following are legal lines of Java code for changing the value of x to 1?

1. x++;

2. x = x + 1;

3. x += 1;

4. x =+ 1;

1, 2 & 3 | 1 & 4 | 1, 2, 3 & 4 | 3 & 2 |

Workspace

5. Which of these statements are incorrect?

Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms. | Assignment operators run faster than their equivalent long forms. | Assignment operators can be used only with numeric and character data type. | None |

Workspace

6. What should be expression1 evaluate to in using ternary operator as in this line?

expression1 ? expression2 : expression3

Integer | Floating – point numbers | Boolean | None of the mentioned |

Workspace

7. What is the value stored in x in following lines of code?

int x, y, z;

x = 0;

y = 1;

x = y = z = 8;

0 | 1 | 9 | 8 |

Workspace

8. What is the order of precedence (highest to lowest) of following operators?

1. &

2. ^

3. ?:

1 -> 2 -> 3 | 2 -> 1 -> 3 | 3 -> 2 -> 1 | 2 -> 3 -> 1 |

Workspace

9. Which of these statements are incorrect?

Equal to operator has least precedence. | Brackets () have highest precedence. | Division operator, /, has higher precedence than multiplication operator. | Addition operator, +, and subtraction operator have equal precedence. |

Workspace

12. Which of the following assignment operator does not exist in Java?

>> | %= | >>> | <<< |

Workspace

13. What is/are highest order precedence operator(s) in Java?

( ) | { } | both a and b | None of these |

Workspace

14. The order of precedence from highest to lowest is :

&&, /, |,{} | %, <=, &&, = | <, !, ==, ++ | +, -, [], != |

Workspace

15. The && and || operators

Combine two numeric values | Compare two boolean values | Combine two boolean values | Compare two boolean values |

Workspace