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 |
What is static synchronization?
What is a consumer in java?
What is java used for?
Where and how can you use a private constructor?
Features of Java?
What is void data type?
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...
List some features of the abstract class.
Is empty .java file name a valid source file name?
What is natural ordering in java?
Can we override constructors in java?
Can we have more than one package statement in the source file?