How to auto-format code in Eclipse?

HasanAboShally picture HasanAboShally · Mar 27, 2013 · Viewed 611.3k times · Source

How do you auto-format code in Eclipse?

Answer

HasanAboShally picture HasanAboShally · Mar 27, 2013

On Windows and Linux : Ctrl + Shift + F

On Mac : + + F

(Alternatively you can press Format in Main Menu > Source)