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
|
Which of these lines of Java code will give better performance? 1. a | 4 + c >> b & 7; 2. (a | ((( 4 * c ) >> b ) & 7 ))
Solution |
4
Discuss
|
On applying Left shift operator, <<, on integer bits are lost one they are shifted past which position bit?
Solution |
5
Discuss
|
Decrement operator, −−, decreases the value of variable by what number?
Solution |
6
Discuss
|
Which of the following can be operands of arithmetic operators?
Solution |
7
Discuss
|
Which of these statements are incorrect?
Solution |
8
Discuss
|
Can 8 byte long data type be automatically type cast to 4 byte float data type?
Solution |
9
Discuss
|
What will be the output of the following Java code?
Solution |
10
Discuss
|
Which operator is used to invert all the digits in a binary representation of a number?
Solution |
# | Quiz |
Copyright © 2020 Inovatik - All rights reserved