What do you mean by definite assignment in C#?

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

C# obeys Definite Assignment policy.

Definite Assignment policy:
It states that, If there is any free space in the memory, that cannot be accessed by any outside members.

It has three implications,
1. Local variables need to get assigned by any value before they are about to read.
2. Function arguments must be supplied while calling any method.
3. Some of the elements like fields, arrays etc. are automatically initialized by the runtime.


Asked In: Spotted While Learning | Alert Moderator 

Comments or Responses

Login to post response