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


Please Help Members By Posting Answers For Below Questions

What is use of a abstract variable?

534


What is JDBC Driver interface?How can you retrieve data from the ResultSet

1507


What is Garbage Collection in Java

607


What is primitive array?

514


Is space a char?

524






how to write a server program and sending the mails to the server using smtp protocol please help me

1546


What are the differences between stringbuffer and stringbuilder?

536


Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx

1601


Is string passed by reference in java?

546


What is class forname used for?

538


What is generic class?

644


What is the final method?

597


What are the differences between heap and stack memory?

543


Is double bigger than float?

543


What 4 doubled?

542