What is difference between var and dynamics ?

In simple and one line answer is, var is statically typed where dynamic is not.

Let me explain when you declared like var x="subhan";

Then compiler understands x as a string at compile time and if you try to divide this x by any integer value suppose 10 then it will show you the compile-time error because the type of x has been decided at compile time.

In another hand if you declare any variable using dynamic like dynamic y="subhan"; this will be accepted at compile time but runtime it will show error.


What is difference between Project Application and Web Application in .Net ?

Comments

  1. Thank you for giving this useful information in this article. It's a fantastic article. I'll be waiting for your next update. I also have some useful information about the Best Custom Software Development Company in India, which I believe will be of great use to you.

    ReplyDelete

Post a Comment

Popular posts from this blog

What is unqork?

What is single page Application in web applications

What is SOLID Principle ?