Fixing the ‘Use of unassigned local variable’ with a null assignment. Why? [duplicate]

When you assign null to the variable you’re telling the compiler to back off because you know better than him so he should not complain about this.

This is probably due to the fact that assigning null is considered to imply an explicit action by the developer.

Leave a Comment