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 static synchronization?

0 Answers  


What is a consumer in java?

0 Answers  


What is java used for?

0 Answers  


Where and how can you use a private constructor?

0 Answers  


Features of Java?

4 Answers  


What is void data type?

0 Answers  


if arraylist size is increased from initial size what is the size of arraylist...suppose initial is 100 , if i add 101 element what is the size...

10 Answers  


List some features of the abstract class.

0 Answers  


Is empty .java file name a valid source file name?

0 Answers  


What is natural ordering in java?

0 Answers  


Can we override constructors in java?

0 Answers  


Can we have more than one package statement in the source file?

0 Answers  


Categories