0

If i have a bunch of code that is just 1 big line is there any way to convert it to normal looking code, im using Intellij.

from this:

public class Test {public void methodName(){System.out.println("Example");}}

to this:

public class Test {
    public void methodName(){
        System.out.println("Example");
    }
}
Juxectar
  • 15
  • 3

1 Answers1

0

The auto-formatter should work for this:

The auto-formatting shortcut in IntelliJ

  • For windows Ctrl+Alt+L.
  • For ubuntu Ctrl+Alt+windows+L.
  • For Mac Command+Option+L.

(copy pasted from this answer)

In the future, as you learn more about what keywords to look for you can find the answers to these questions yourself. I noticed in your other question you said you were still learning, so for now it's ok as long as you tried searching before asking here. That said, this is a clear question with a good example of what you were trying to do.

getfugu
  • 140
  • 1
  • 5
  • thanks very much, i was looking all over for this feature but as you said i didnt know of the auto formatting keyword which didnt give me the answer i needed when looking for it. – Juxectar Jul 26 '19 at 11:07