How to make code-style arrangement keep the public static void main() method last in the class

Answered

This used to work for me but I can not get it to work at all anymore.  Does anyone have any ideas?  I am on the latest version of intellij ultimate but it stopped working a few versions ago at least.

0
2 comments
Hi, you can add a new rule in Settings | Editor | Code Style | Java | Arrangement to make [ method ] [ public ] [ static ] [ name:main] as the last method in the order.
Then in your java file, please take the action: Rearrange Code
1

Thanks, I think I found my issue.  

When I check “Keep dependent methods together” - it no longer keeps the main at the end like I want.  I will have to understand this option more, but for now I will keep it off so things work better.

0

Please sign in to leave a comment.