What is the "Default" Keyword in C#?

 Posted by vishalneeraj-24503 on 9/5/2014 | Category: C# Interview questions | Views: 2483 | Points: 40
Answer:

Default Keyword returns the default value when the object is not initialized. For example,we all know integers are initialized to 0 if not given any value. Characters are Empty when not given any value,objects are null when not assigned any value.
For Example:-
int x = default(int);//will be assigned to 0.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response