Java MCQ Questions - Operators & Assignments

This section focuses on the "operators and assignments" in Java programming. These Multiple Choice Questions (MCQ) should be practiced to improve the Java programming skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements and other competitive examinations.

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

A. Characters
B. Boolean
C. Numeric
D. Both Numeric & Characters

View Answer

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

A. Both Integers and floating - point numbers
B. Integers
C. Floating - point numbers
D. None of the mentioned

View Answer

3. Decrement operator, −−, decreases the value of variable by what number?

A. 1
B. 2
C. 3
D. 4

View Answer

4. Which of these statements are incorrect?

A. Assignment operators can be used only with numeric and character data type
B. Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms
C. Assignment operators run faster than their equivalent long forms
D. None of the mentioned

View Answer

5. Can 8 byte long data type be automatically type cast to 4 byte float data type?

C. Can be true or false
D. can not say

View Answer

6. Evaluate the value of the expression?

		   6 - 2 + 10 % 4 + 7

A. 14
B. 12
C. 13
D. 10

View Answer

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

A. ( )
B. { }
C. Both A & B
D. None of these

View Answer

8. The && and || operators

A. Compare two boolean values
B. Compare two numeric values
C. Combine two boolean values
D. Combine two numeric values

View Answer

9. Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?

A. ((x < 100) && (x > 1)) && (x < 0)
B. ((x < 100) && (x > 1)) || (x < 0)
C. (1 > x > 100) || (x < 0)
D. 1 < x < 100 || x < 0

View Answer

10. Select from among the following character escape code which is not available in Java.

A. \\
B. \v
C. \a
D. \t

View Answer

Also check :


* You must be logged in to add comment.