Question:
What is final variable?
Answer:
Final variable: Final variable is a variable ,you can't modify it.It is just like "const" variable int c/c++.Final variable must initialialized other wise it leads to compile errors.Final variable can't inherited into derived class. eg: final int a; // compile error. final int a=10; //no error. Submitted by Devarathnam.C ([email protected]) Source: CoolInterview.com
The value of a final variable can not be changed
ie like final int a = 10 ; the value of a can not be changed ie u can not further write like a = 8 ; Source: CoolInterview.com
Answered by: redflixoozz | Date: 4/28/2010
| Contact redflixoozz
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|