• 请不要在回答技术问题时复制粘贴 AI 生成的内容
vincel
V2EX  ›  程序员

声明变量的时候,应该 final 在前面还是 static 在前面

  •  
  •   vincel · May 15, 2019 · 4655 views
    This topic created in 2580 days ago, the information mentioned may be changed or developed.

    比如 应该是 final static int a; 还是 static final int a;

    6 replies    2019-05-15 14:19:08 +08:00
    fhsan
        1
    fhsan  
       May 15, 2019
    一样的效果和 string[] args, sting args[],不过习惯 static final 和方法修饰符一致。
    yukiww233
        3
    yukiww233  
       May 15, 2019
    static 在前顺眼,idea 的 live template 就是 psf
    fuchaofather
        4
    fuchaofather  
       May 15, 2019
    没什么规矩, 不过 jdk 源码是 static 在前
    johnj
        5
    johnj  
       May 15, 2019
    无所谓 统一就好
    Mogugugugu
        6
    Mogugugugu  
       May 15, 2019
    static 在前,有些傻逼规则会 check - -
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6136 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 03:11 · PVG 11:11 · LAX 20:11 · JFK 23:11
    ♥ Do have faith in what you're doing.