What is a reasonable order of Java modifiers (abstract, final, public, static, etc.)?

后端 未结 4 800
灰色年华
灰色年华 2020-11-29 16:11

What is a reasonable order of Java modifiers?

  • abstract
  • final
  • native
  • private
  • protected
  • public
  • static
4条回答
  •  难免孤独
    2020-11-29 16:44

    It is reasonable to use the order according to the Java Virtual Machine Specification, Table 4.4

    • public
    • protected
    • private
    • abstract
    • default
    • static
    • final
    • transient
    • volatile
    • synchronized
    • native
    • strictfp

提交回复
热议问题