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.

Challenge: Create a class that represents a data object

Challenge: Create a class that represents a data object

From the course: IntelliJ IDEA Community Edition Essential Training

Start my 1-month free trial

Challenge: Create a class that represents a data object

(upbeat music) - [Narrator] In this challenge I'll ask you to build a new Java class named invoice. The invoice will have a single constructor. Now, if you're new to Java that just means it's a method that has the same name as the class itself and this class should have three private fields, a title which is a string, an instance of the Java date class where the name of the field is date and a value which will be a double value. Then when you call system..println and you pass that invoice in you should see output that looks like this. This will be part of a two string method. Now, as I showed in a previous video you can generate a lot of that code automatically using intelligent ideas generate tools. Start with a brand new project then create this invoice class and I'm not going to show you what it looks like yet. I'll show you that in the solution and then add this code in the main method to create an instance of the invoice…

Contents