Email: Password:       Forgot Password 
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.

Initialize VAR in C Sharp

Viewed:  924 
Posted On:  14/06/2015 20:39:20 
How we can Initialize VAR in c# ? 


While working with var in c# if you need to initialize var then normally we think like below:

var qq=null;

If we do like above then we will get below error:


Image 1.

So to solve this use initialize your var like below:

As you can see I want to store a List in my var:


Image 2.

It depends what you want to store in your list: I f you want string then use below:

string y = null;

var qq = y;

         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us