Can a final variable be initialized in constructor?



Can a final variable be initialized in constructor?..

Answer / Prabal Chatterjee

Yes, you can initialize a final variable in a constructor. However, once the variable is initialized, it cannot be reassigned.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?

1 Answers   PUCIT,


How are variables stored in memory?

1 Answers  


can we Connect Applet to Data Base ? with Discriptiom. and also What is Diff. from Applet & Servlet?

1 Answers   Systematix,


What is final int?

1 Answers  


What is the base class for error and exception?

1 Answers  


What is the benefit of abstract class?

1 Answers  


Is cout buffered?

1 Answers  


What is java in detail?

1 Answers  


what is ABSTRACTION and what are using in real time project?

1 Answers   iGate,


Which is better arraylist or vector?

1 Answers  


What is the benefit of using enum to declare a constant?

1 Answers   Aspire, Infogain,


What is a singleton in genetics?

1 Answers  


Categories