【发布时间】:2017-06-21 15:44:46
【问题描述】:
您能否分享 JLS/JEP 或其他 Oracle/Twitter/Google Java 代码样式约定文档,其中声明了类元素的位置。 喜欢:
class Example {
// public static final variables
// private static final variables
// static variables
// class variables
// constructors
// public methods
// protected methods
// inner classes
// nested classes
// static methods
// setter1
// getter1
//...
// setterN
// getterN
}
【问题讨论】:
-
Google 提供了一个很好的工具来查找这些信息。
-
这里:google.github.io/styleguide/… Google 写道,没有强烈声明课程内容的顺序。这是答案吗?
-
没有一个答案。不同的指南会有不同的规则。
标签: java coding-style