How do you declare constants that are only needed in a small scope (function or smaller)? I declare them in the tightest scope as final with an all-caps name. I.e.:
final int THRESHOLD = 1000;
That coveys the intent that it is a constant but minimizes scope.
No comments:
Post a Comment