Pages

Thursday, 20 March 2014

How to Initialize Objects By Using Object Initializer (C#)




 There are many ways to initialize an object. But using this method you can initialize your object from one line of code. So this is efficient and easy for the developer. No need to write repeating object names to set the properties of the initializing object. As my experience this way it is easy to track and trace errors of your code. No more talking lets see how to do it;

I will you a class called student, then I will initialize it in the later code;

No comments:

Post a Comment