What will be the output of the following Java program?
public class variable_scope
{
public static void main(String args[])
{
int x;
x = 5;
{
int y = 6;
System.out.print(x + " " + y);
}
System.out.println(x + " " + y);
}
}
5 6 5 6
5 6 5
Runtime error
Compilation error
Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api
# | Quiz |
---|---|
1
Discuss
|
Which of these can not be used for a variable name in Java?
Solution |
2
Discuss
|
Which of these can be returned by the operator &?
Solution |
3
Discuss
|
Which of these is long data type literal?
Solution |
4
Discuss
|
What will be the output of the following Java program?
Solution |
5
Discuss
|
What will be the output of the following Java program?
Solution |
6
Discuss
|
What will be the output of the following Java program?
Solution |
# | Quiz |
Copyright © 2020 Inovatik - All rights reserved