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);
}
}
Answer Posted / 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 View All Answers
What is the difference between numeric and integer?
Define max and min heap, also the search time of heap.
What is boolean false?
What is a "pure virtual" member function?
Can arraylist hold different types java?
What is an immutable class? How to create an immutable class?
how would you implement a thread pool? : Java thread
Define a java class.
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
Is array size fixed in java?
What is the purpose of javac exe?
What does math floor () do?
what are the states associated in the thread? : Java thread
What is data movement?
What is difference between adapter class and listener?