vamsi
vamsi
1 Answer(s)      5 years and 9 months ago
Posted in : Java Beginners

what is the difference between final and constant

Ads

View Answers

December 21, 2010 at 5:46 PM


Hi Friend,

Differences:

1) In final keyword the value of variable remain constant throughout the execution of program. And constant also remains unchanged but we can inherit the constant variable.

2) Final can be used with variable, methods or class, and we use constant with variables

3) Constant value is identified when program is running whereas final value may or may not be recognized at runtime.

Thanks










Related Tutorials/Questions & Answers:
JAVA N HTML - JavaMail
JAVA N HTML  How to use HTML's mailto tag in a java application.. please give me reply as soon as possible.. i've to submit my project on coming monday... Please Help Me.. Thanks Vamsi Krishna  Hi Friend
Advertisements

Ads

Advertisement