2017  Kodetalk | Feedback | Privacy Policy | Terms | About

auto-format code in Eclipse?

what is  is the shortcut to auto-format code in Eclipse?

Except Mac it use the below commad.

Press: Ctrl + Shift + F

On Mac

⌘ + ⇧ + F

Or, in the main menu > Source > Format

U can follow this also,

Another option is to go to Window->Preferences->Java->Editor->SaveActions and check the Format source code option. Then your source code will be formatted truly automatically each time you save it.

Answer is