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
How do I get a substring?
How to check if a list is sorted in java?
How do you declare an array that will hold more than 64KB of data?
Is void a wrapper class?
Why is string class considered immutable?
Why main method is called first in java?
Can we synchronize static methods in java?
What is array length?
What is command line argument
Write java program to reverse string without using api?
What are the six ways to use this keyword?
Define class?
How can we pass argument to a function by reference instead of pass by value?
how many types of Inheritance?
What is the difference between an array and an array list?