Java | final keyword | Question 2
Output of follwoing Java program
(B) Compiler Error
(D) Garbage value
Explanation: There is no error in the program. final variables can be assigned value only once. In the above program, i is assigned a value as 20, so 20 is printed.
Quiz of this Question