Search code examples
javaintellij-ideacode-formatting

Intellij IDEA Java code formatting: can I force a newline after public and before a method return type?


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?


Solution

  • 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".