Dave's Brain

Browse - Programming Tips - Should you write "static final" or "final static" ?

Date: 2014sep10
Language: Java
Keywords: order, syntax, keywords

Q.  Should you write "static final" or "final static" ?

A.  Both are legal but the convention is "static final".  For example:

public static final int NUMBER = 123; private static final int NUMBER = 123;
By the way, I avoid "static" and "final" in example code here on davekb unless its necessary. But I use both in production code.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.