In C#, to create an object of a class, you have to use the newkeyword. Let's look at an example of an object:
Customer customer1 = new Customer();
Here, we started by writing Customer, which is the name of the class. This represents the type of the object. After that, we gave the name of the object, which in this case is customer1. You can give any name to that object. For example, if the customer is Mr. Jones, we could name the object jackJones. After the object name, we then inserted an equals sign (=), which means that we are assigning a value to thecustomer1 object. After that, we entered a keyword called new, which is a special keyword that tells the compiler to create a new object of the class that is given next to it. Here, we gave Customeragain with()next to it. When we placeCustomer(), we are actually calling the constructor of that class. We will talk about constructors in subsequent chapters.
We can create jackJones by using the following code: