C Programming Multiple Choice Questions (MCQ) | IT Developer <?php echo $page_title; ?>
IT Developer

Java Programming Multiple Choice Questions (MCQ)

Introduction to Java - Multiple Choice Questions (MCQ) - Set 21



Share with a Friend

Multiple Choice Questions


Java - Introduction to Java - Multiple Choice Questions (MCQ) - Set 21

101. Which of these have highest precedence?
A). ()
B). *
C). >>
D). ++
View Answer
Correct: A




102. What should be expression1 evaluate to in using ternary operator as in this line?
 expression1 ?  expression2  :  expression3
A). Floating – point numbers
B). Integer
C). Boolean
D). None of the mentioned
View Answer
Correct: C




103. What is the value stored in x in the following lines of Java code?
   int x, y, z;
    x = 0;
    y = 1;
    x = y = z = 8;
A). 1
B). 9
C). 0
D). 8
View Answer
Correct: D




104. What is the order of precedence (highest to lowest) of following operators?
    1. &    
    2. ^
    3. ?:
A). 1 -> 2 -> 3
B). 2 -> 1 -> 3
C). 3 -> 2 -> 1
D). 2 -> 3 -> 1
View Answer
Correct: A




105. Which of these statements are incorrect?
A). Equal to operator has least precedence
B). Addition operator and subtraction operator have equal precedence
C). Division operator has higher precedence than multiplication operator
D). Brackets () have highest precedence
View Answer
Correct: C