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

If I only change the return type, does the method become overloaded?

0 Answers  


How many types of flags are there?

0 Answers  


Explain a few methods of overloading best practices in java?

0 Answers  


What are java methods?

0 Answers  


Why arraylist is not synchronized in java example?

0 Answers  






What is the meaning of I ++ in java?

0 Answers  


Difference between process and thread?

0 Answers   HP,


What super () does in java?

0 Answers  


Explain different ways of passing arguments to sub-routine?

1 Answers  


What are the different http methods?

0 Answers  


Why do we need autoboxing in java?

0 Answers  


Difference between method overloading and overriding.

0 Answers  


Categories