Quick Java question about private static final keywords for fields

前端 未结 7 1089
梦如初夏
梦如初夏 2020-12-13 18:48

I\'m declaring a field:

private static final String filename = \"filename.txt\";

First, does the order of private static final

相关标签:
7条回答
  • 2020-12-13 19:15

    To complete the nice answer by @Hobo above by a current link

    8.1.1. Class Modifiers

    A class declaration may include class modifiers.

         ClassModifier:
             (one of) 
             Annotation public protected private 
             abstract static final strictfp
    

    [...]

    If two or more (distinct) class modifiers appear in a class declaration, then it is customary, though not required, that they appear in the order consistent with that shown above in the production for ClassModifier.

    0 讨论(0)
提交回复
热议问题