What is the output of the following Java program no. 11?
- class Main {
- public static void main(String args[]){
- final int i;
- i = 20;
- System.out.println(i);
- }
- }
Output
20
Explanation
Since i is the blank final variable. It can be initialized only once. We have initialized it to 20. Therefore, 20 will be printed.
Recent Posts