Java Coder
What is the purpose of declaring a variable as final?
1 Answer(s)      2 years and 4 months ago
Posted in : Java Beginners

Hi,

What is the purpose of declaring a variable as final?

Thanks

Advertisement
View Answers

April 11, 2013 at 1:44 PM


Hi,

In Java when we declare a final variable as a variable which has been initialized to a fixed value which cannot be changed after initialization. Once a variable declare/create as final its value never changed.

For more Details: http://www.roseindia.net/java/jdk7/variables.shtml

thanks,










Related Tutorials/Questions & Answers:
Advertisements