编程语言
首页 > 编程语言> > Java 修饰符顺序 the sequential order of the modifiers

Java 修饰符顺序 the sequential order of the modifiers

作者:互联网

  

 

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

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.

Noncompliant Code Example
static public void main(String[] args) { // Noncompliant
}
Compliant Solution
public static void main(String[] args) { // Compliant
}
————————————————
版权声明:本文为CSDN博主「Mr_YDK」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ydk888888/article/details/80288930

标签:modifiers,Java,String,args,修饰符,Compliant,static,order
来源: https://www.cnblogs.com/dissipate/p/14980353.html