What will be the output of the following Java code?
class Output
{
public static void main(String args[])
{
int x , y = 1;
x = 10;
if (x != 10 && x / 0 == 0)
System.out.println(y);
else
System.out.println(++y);
}
}
1
2
Runtime error owing to division by zero in if condition
Unpredictable behavior of program
Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api
# | Quiz |
---|---|
1
Discuss
|
Which of these have highest precedence?
Solution |
2
Discuss
|
What will be the output of the following Java code?
Solution |
3
Discuss
|
What will be the output of the following Java code?
Solution |
4
Discuss
|
What will be the output of the following Java program?
Solution |
5
Discuss
|
Can 8 byte long data type be automatically type cast to 4 byte float data type?
Solution |
6
Discuss
|
What will be the output of the following Java program?
Solution |
7
Discuss
|
Which of these is returned by “greater than”, “less than” and “equal to” operators?
Solution |
8
Discuss
|
What is the output of relational operators?
Solution |
9
Discuss
|
What will be the output of the following Java code?
Solution |
10
Discuss
|
Which of these statements are incorrect?
Solution |
# | Quiz |
Copyright © 2020 Inovatik - All rights reserved