From the course: IntelliJ IDEA Community Edition Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Reformat code and optimize imports
From the course: IntelliJ IDEA Community Edition Essential Training
Reformat code and optimize imports
- [Instructor] When you're coding in a hurry, you sometimes don't pay attention to things like indentation or line feeds to make your code readable. IntelliJ IDEA can clean all that up for you with a tool called Reformat Code. Here's a couple of ways you can use it. I'll start with this class called Person. And I'm going to select everything. And I did that by pressing Command A on Mac or Control A on Windows. Then I'll press Shift and Tab a few times to indent everything over to the left. Now, I want to add indentation back in. I'll click anywhere in the code editor. Then I'll go to the menu and choose Code, Reformat Code. And everything is fixed instantly. Now, there's another way of using that reformat code tool. I'm going to press Command Z for undo on Mac or Control Z on Windows. And now I'm back in that same state. And now, I'll come back over to my project window. And with Person.java selected, I'll click on this…
Contents
-
-
-
-
-
Create new packages, classes, and interfaces1m 30s
-
(Locked)
Generate boilerplate code2m 49s
-
(Locked)
Reformat code and optimize imports4m 34s
-
(Locked)
Navigate code and find files2m 39s
-
(Locked)
Refactor code4m 1s
-
(Locked)
Create and use live templates2m 34s
-
(Locked)
Store code in scratch files2m 22s
-
(Locked)
Challenge: Create a class that represents a data object1m 9s
-
(Locked)
Solution: Create a class that represents a data object3m 10s
-
-
-
-
-
-