Creates a new instance of Customer() and assigns a reference to the newly created object to the cust variable.
If you want to remove the repetition, and you are using C # 3.0 or later, and this is a local variable, you can use:
var cust = new Customer();
This has exactly the same meaning - it is still statically typed, i.e. The cust variable is still very definitely of type Customer .
Now in this case it repeated, but two bits of Customer completely separated. The first is the type of variable, the second is to indicate which constructor should be called. They could be of different types:
Customer cust = new ValuedCustomer(); IClient cust = new Customer(); object cust = new Customer();
etc .. This only happens because you created an instance of exactly the same type as the type of the variable in which the repetition occurred.
Jon skeet
source share