英文:
Intellij IDEA Java code formatting: can I force a newline after public and before a method return type?
问题
我想让我的Java方法声明看起来像:
static public
boolean method1(int arg1) {
...
}
其中在public
之后和boolean
之前有一个换行。在IntelliJ IDEA中有办法实现这个吗?
英文:
I would like my java method declarations to look like:
static public
boolean method1(int arg1) {
...
}
where there is a newline after public
and before boolean
. Is there a way to do that in IntelliJ IDEA?
答案1
得分: 1
这是一个相关的帖子。
Software Engineering Stack Exchange – 在C中将函数类型和方法名称放在不同行的原因。
您可以在 设置 > 编辑器 > 代码样式 > Java 中找到此选项。
标题是 "Modifer list",选项是 "Wrap after modifier list"。
英文:
Here is a relevant post.
Software Engineering Stack Exchange – Reason for placing function type and method name on different lines in C.
You can find this in Settings > Editor > Code Style > Java.
The title is, "Modifer list", and the option is "Wrap after modifier list".
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论