What is use of static, final variable?

What is use of static, final variable?

If you modify a variable or method by a static modifier it means there is only one copy of that variable or method shared by all theinstances of that class. A class can not be modified as static,but an inner class.

 A final variable is just like a constant. It\'s value can not be change once it is initialized. It must be initialized at the time of variable declaration or the constructor completed.


By:Jalees
Date:2011-01-09 00:00:00

If you modify a variable or method by a static modifier it means there is only one copy of that variable or method shared by all theinstances of that class. A class can not be modified as static,but an inner class.

 A final variable is just like a constant. It\'s value can not be change once it is initialized. It must be initialized at the time of variable declaration or the constructor completed.


By:Sumit Tripathi
Date:2018-05-15 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher