Java语言规范的修饰符顺序

The Java Language Specification recommends listing modifiers in the following order:

Java语言规范建议按以下顺序列出修饰符:

  1. Annotations
  2. public
  3. protected
  4. private
  5. abstract
  6. static
  7. final
  8. transient
  9. volatile
  10. synchronized
  11. native
  12. strictfp

Not following this convention has no technical impact, but will reduce the code's readability because most developers are used to the standard order.

不遵循此约定没有技术上的影响,但会降低代码的可读性,因为大多数开发人员习惯于标准顺序。

posted @ 2022-08-22 19:27  进击的小蔡鸟  阅读(145)  评论(0编辑  收藏  举报