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);
}
}
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 |
When does a class need a virtual destructor?
Is it compulsory to have atleast one abstract method in abstract class?
What are command line arguments?
Explain restrictions on using enum?
heavy components means what?
Why runnable interface is used in java?
How does the java compiler work?
What is the use of arraylist in java?
Sample code to retrieve objects from HashMap in sorted ascending order?
What is difference between static class and normal class?
Is array a class?
What is hash code collision?