From the course: IntelliJ IDEA Community Edition Essential Training
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Solution: Create a class that represents a data object
From the course: IntelliJ IDEA Community Edition Essential Training
Solution: Create a class that represents a data object
(upbeat music) - [Instructor] In the previous video, I gave you the challenge of creating a class that represented an instance of a data object. The name of the class would be invoice, and it would have a title, a date, and a value. Now, before I create the class I want to show you how I've configured this project. I'll go to the menu and select File and Project Structure. And I've set my project SDK at Java 15, and also the project language level at Java 15. Now, I'll go to my com.example package, right-click and choose New, Java Class and I'll name the class Invoice and I'll set it as a class. Now, I'll declare my private fields. I'll type private and then the data type and then I'll set the field name as title. Then I'll do the same thing. And this time it's going to be an instance of the Java Date class. And this is the Date class from java.util. When I select that class, the import is added at the top and then the…
Contents
-
-
-
-
-
Create new packages, classes, and interfaces1m 30s
-
Generate boilerplate code2m 49s
-
Reformat code and optimize imports4m 34s
-
Navigate code and find files2m 39s
-
Refactor code4m 1s
-
Create and use live templates2m 34s
-
Store code in scratch files2m 22s
-
Challenge: Create a class that represents a data object1m 9s
-
Solution: Create a class that represents a data object3m 10s
-
-
-
-
-
-