 
| Search Interview Questions |  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. | 
| 
 | |||
|  | ||||
| Interview Questions and Answers | ||||
| 
 | ||||
| Ans. NUMBER_OF_DAYS_IN_MONTH_31 Constant should be such that it uniquely identifies the value it holds and context of the value. THIRTY_ONE uniquely identifies the value but doesn't express the context. NUMBER_OF_DAYS_IN_MONTH expresses the context but doesn't specify the value clearly as different month can have different number of days. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   constant variables  static final variable  java conventions  java naming conventions | ||||
|  Related Questions | ||||
|  What are the conventions regarding constant variables or static final variables ? | ||||
|  What is the advantage of using static final or constant variables in Java ? | ||||
|  If we have to maintain a value "7" denoting "number of days in a week" as constant variable, Which of the following is the best constant name and Why ? SEVEN NUMBER_OF_DAYS_IN_WEEK NUMBER_OF_DAYS_IN_WEEK_7 | ||||
|  Would you consider creating a constant name for "null" ? | ||||
|  How do we define constant variables in Java ? | ||||