How to format code in Java?

How to format code in Java?

To format a specific code, open the necessary file. Choose Source-> Format Document or click Ctrl+Shift+F.

Learn about IntelliJ format code: https://www.eclipse.org/pdt/help/html/formatting_code.htm