What are the default values in C#?

 Posted by Goud.Kv on 9/3/2014 | Category: C# Interview questions | Views: 1142 | Points: 40

Default values are the values declared by the compiler by default if a programmer did not assigned any value.

default keyword is used to get the default values.

It results as bitwise zeroing of the memory.

-For all the reference types, the default value will be null.
-For all enum types, it is 0.
-For all bool types, it will be false.
-For all numeric types, it is 0.
-For all char types, it will be \0.

Asked In: Spotted While Learning | Alert Moderator 

Comments or Responses

Login to post response