What will be the output of the following Java program?
class rightshift_operator
{
public static void main(String args[])
{
int x;
x = 10;
x = x >> 1;
System.out.println(x);
}
}
10
5
2
20
Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api
# | Quiz |
---|---|
1
Discuss
|
What will be the output of the following Java program?
Solution |
2
Discuss
|
Which of these statements are incorrect?
Solution |
3
Discuss
|
What will be the output of the following Java program?
Solution |
4
Discuss
|
What will be the output of the following Java code?
Solution |
5
Discuss
|
Which of these is returned by “greater than”, “less than” and “equal to” operators?
Solution |
6
Discuss
|
Which of these statements are incorrect?
Solution |
7
Discuss
|
Decrement operator, −−, decreases the value of variable by what number?
Solution |
8
Discuss
|
Which of these lines of Java code will give better performance? 1. a | 4 + c >> b & 7; 2. (a | ((( 4 * c ) >> b ) & 7 ))
Solution |
9
Discuss
|
What is the order of precedence (highest to lowest) of following operators? 1. & 2. ^ 3. ?:
Solution |
10
Discuss
|
What will be the output of the following Java code?
Solution |
# | Quiz |
Copyright © 2020 Inovatik - All rights reserved