Java - MCQ
Multiple Choice Questions
Java - Multiple Choice Questions (MCQ) - Introduction to Java - Set 1
1. Which of the following can be operands of arithmetic operators?
A). Numeric
B). Boolean
C). Characters
D). Both Numeric & Characters
View Answer
Correct: D
2. Modulus operator, %, can be applied to which of these?
A). Integers
B). Floating – point numbers
C). Both Integers and floating – point numbers
D). None of the mentioned
View Answer
Correct: C
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;
A). 1, 2 & 3
B). 1 & 4
C). 1, 2, 3 & 4
D). 3 & 2
View Answer
Correct: C
4. Decrement operator, --, decreases the value of a variable by what number?
A). 1
B). 2
C). 3
D). 4
View Answer
Correct: A
5. Which of these statements are incorrect?
A). Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms
B). Assignment operators run faster than their equivalent long forms
C). Assignment operators can be used only with numeric and character data type
D). None of the mentioned
View Answer
Correct: D