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);
}
}



What is the output of the following Java program? class Main { public static void main(String a..

Answer / 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

More Core Java Interview Questions

how to print the below in java? * * * * * * * * *

2 Answers  


What exceptions occur during serialization?

0 Answers  


how to use crystal reports in java

2 Answers  


What is java lang string?

0 Answers  


Is it possible to compare various strings with the help of == operator? What are the risks involved?

0 Answers  






what is meaning of JIT?

4 Answers  


Enlist few advantages of inheritance?

0 Answers  


Is it necessary that each try block must be followed by a catch block?

0 Answers  


How many types of memory areas are allocated by JVM in java?

0 Answers   UGC Corporation,


Name container classes in java programming?

0 Answers  


What is getkey () in java?

0 Answers  


Why there are some null interface in java? What does it mean?

0 Answers  


Categories