Using var we can store any thing, then why all remaining datatypes? [Resolved]

Posted by Iamnharish under C# on 2/2/2012 | Points: 10 | Views : 904 | Status : [Member] | Replies : 3
Hi i have just seen the advantage of "var" keyword in c#.net code, But i have doubt that if we are able to store any type data using var keyword then why we need to know all other data types and learn all that syntax, all can simply use var keyword...pls clarify what is the need of other data types???




Responses

Posted by: Pradeepkumar417 on: 2/2/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi,

You can declare "var" keyword in the methods only but the declaration in the class does not allow
But you can declare other data types anywhere.

Thanks & Regards,
Software Engineer,
Pradeep Kumar

Iamnharish, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Iamnharish on: 2/2/2012 [Member] Starter | Points: 25

Up
0
Down
Thanks for the reply..could u pls give me ur no. i want to speak..

Iamnharish, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pradeepkumar417 on: 2/2/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

Don't forget to mark as answer it is useful

Thanks & Regards,
Software Engineer,
Pradeep Kumar

Iamnharish, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response