Grzenio
Grzenio

Reputation: 36639

How can I default constants in IntelliJ to private?

When I am creating a constant in IntelliJ (using Ctrl+Alt+C), by default it is public static final. How can I make it private static final instead?

Upvotes: 16

Views: 2295

Answers (1)

Vojtech Ruzicka
Vojtech Ruzicka

Reputation: 17075

After Ctrl+Alt+C, press this shortcut again, which shows dialog with more options.

There is a visibility section. If you select private here, it will be the new default when extracting constants the next time.

See the IntelliJ IDEA documentation: https://www.jetbrains.com/help/idea/extract-constant.html

introduce constant dialogue

Upvotes: 21

Related Questions