The Customer class is meant to describe a customer, i.e. an instance of Customer contains information which is relevant to a customer. Remember, computer language code is written for the purpose of doing something useful, at least in real life it is.
In this example a Customer has a code, which is probably meant to be a customer number. And a Customer has a name, which is a String value. And finally it has an Order, which in real life... well, you know what a customer does when they send in an order. In this case a Customer can only have one order, which isn't all that real-lifey but this exercise is meant to be not too complicated.
And an Order has only an orderId, which is a String value. Of course in real life an order would have more information than that, but again this is meant to be a simple exercise.
A Customer gets its code and its name when it's created by the constructor (line 19), and in this example the code is 1001 and the name is John. And then it can be assigned an Order via its setOrder method (line 21).
Does that help?
Onion rings are vegetable donuts. Taste this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop