Question:

Java: What is FINAL variable?

by  |  earlier

0 LIKES UnLike

I saw some variable declarations starting with he keyword final. What is it?

 Tags:

   Report

2 ANSWERS


  1. Even if the class is subclassed, 'final' properties can't be overridden.


  2. final means that the variable cannot be changed once a value has been assigned to it.  It works similar to the const keyword, but the value for the final is not necessarily known at compile time.

    Usually the value is assigned at declaration but it can be left until later to assign the value.  However, once a value has been assigned it cannot be changed.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.