What is the purpose of declaring a variable as final?

Hi,

What is the purpose of declaring a variable as final?

Thanks

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