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

What is the difference between interface & abstract class?

0 Answers  


How to sort a collection of custom Objects in Java?

0 Answers  


What is a nested class?

0 Answers  


What is a hashmap used for?

0 Answers  


Write a program to reverse array in place?

0 Answers  


What is a container in a gui?

0 Answers  


Can a method be static?

0 Answers  


Explain different data types in Java.

5 Answers  


What is difference between core java and java ee?

0 Answers  


What 4 doubled?

0 Answers  


What is null statement?

0 Answers  


How do you include a string in java?

0 Answers  


Categories