More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. Better Control - If the value is being used at multiple locations , that can be controlled better from single place. Any change would only require making single change.
Meaning , Aliasing and Better Readability - Sometimes its easy to read the value by its meaning or alias ( 0 as ZERO or 0 as NEUTRAL_VALUE ).
Help us improve. Please let us know the company, where you were asked this question :
Ans. Final makes sure that the value doesn't change after initialization and static makes sure that there is only one copy that can be shared across objects.
Making it non static will unnecessarily create a different copy per object wherein the same value will kept for all copies ( as its final and cannot be changed ).
Help us improve. Please let us know the company, where you were asked this question :