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 thread? What are the high-level thread states? : Java thread

0 Answers  


whether java is fully object oriented language or partially object oriented language

4 Answers   Infosys, ME, SMK,


List two java ide’s?

0 Answers  


What is the latest java version?

0 Answers  


What are the advantages of autoboxing?

0 Answers  






What is type safety in java?

0 Answers  


What about interrupt() method of thread class ?

0 Answers  


what is nested class in java?

0 Answers   IBS,


Why is a singleton bad?

0 Answers  


What is difference between public static and void?

0 Answers  


What is java full form?

0 Answers  


What is the default initialized value of a boolean type variable?

3 Answers  


Categories