Let's cover part one task, one was that the necessary fields for the item class and looking back at
the requirements, there are only two.
The fields are private string name.
Private double price.
Now we want to apply the big three steps, the first step is to create a constructor.
It's going to receive two parameters string name and double price, and one, the constructor runs.
We have to set every field in the object equal to a parameter.
This dynamic will name the stock price equals price.
OK, now we want to autocomplete the getters and setters.
And the next task is that a tutoring method, public string.
Two string and just copy the format from the article.
Let's not forget the copy constructor in case we ever need to create copies of an object.
All right, we're done creating the item class, I know this is pretty standard stuff, but we should
always test our code in case we missed something so inside mean I'm going to print three objects of
the item class.
Go ahead and run the code.
And we get the expected output.
For the sake of practice, I'm not a breakpoint.
Launch the debugger.
And let's assume you want to step inside the constructor while it's inside of another function, then
why you would do is step into front line.
Then step out of it, keep repeating the step in and step out process until the next step into leads
us to the constructor for the first object.
Here we see the parameters.
And this points the current object we just created.
And it updates every field in the object with a parameter.
It's going to do the same thing for the spinach and for the coriander objects.