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 are extraneous variables examples?
Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).
What is the meaning of immutable regarding string?
Functionality of JVM?
Under what conditions is an object’s finalize() method invoked by the garbage collector?
If all the methods in abstract class are declared as abstract then what is difference between abstract class and in interface?
How does abstract modifier work?
what is polymorphism with example?types of polymorphism?
How to initialize an Applet ?
What is the need of "creating and throwing an UserdefinedException" when the "Exception" class is already available?
what is difference between Interface and abstract class
Difference between this() and super() ?