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);
}
}
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 |
What is the difference between interface & abstract class?
How to sort a collection of custom Objects in Java?
What is a nested class?
What is a hashmap used for?
Write a program to reverse array in place?
What is a container in a gui?
Can a method be static?
Explain different data types in Java.
What is difference between core java and java ee?
What 4 doubled?
What is null statement?
How do you include a string in java?