What is the output of the following Java program?
class Main {
public static void main(String args[]){
final int i;
i = 10;
System.out.println(i);
}
}
10. What is the output of the following Java program?
class Main {
public static void main(String args[]){
final int i;
i = 10;
System.out.println(i);
}
}
Answer Posted / hrindows@gmail.com
Output
10
Since i is the blank final variable. It can be initialized only once. We have initialized it to Therefore, 10 will be printed.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What does this () mean in java?
Explain the importance of import keyword in java?
Can we define private and protected modifiers for variables in interfaces?
What is the difference between member variables initialization and assignment in a constructor?
Is singleton class immutable?
What about member inner classes?
What is the differences between c++ and java? Explain
Is multiple inheritance supported by java?
How are the elements of a gridbaglayout organized?
What does nullpointerexception mean?
How to perform selection sort in java?
What is volatile data type?
What is the use of hashmap in java?
How do you replace a string in java?
What restrictions are placed on method overloading in java programming?