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 |
abstract class Demo { public void show() { System.out.println("Hello I am In show method of Abstract class"); } } class Sample extends Demo { public void show() { super.show(); System.out.println("Hello I am In Sample "); } } public class Test { public static void main(String[] args) { //I WANT TO CALL THE METHOD OF BASE CLASS IT IS POSSIBLE OR NOT CAN WE USE SCOPE RESOLUTION OPERATOR TO CALL OR JAVA NOT SUPPORTED THAT :: OPERATORE } }
What is multiple inheritance & can we implement it in java?
How do you remove all elements from an arraylist in java?
Can arraylist hold different types java?
What is the difference between a static and a non-static inner class in java programming?
what is the replacement for GOTO in java?
What is map and hashmap? also tell the difference.
What happens if an exception is not caught?
What is thread safe in java?
what is webservices
5 Answers Consultancy, Mind Tree,
what is use of business objects?
What is the core java?