Skip to main content

Redundant field initialization

In This Article

CodeRush Classic shows the Redundant field initialization code issue if a field is initialized to its default value.

#Fix

Remove the redundant field initialization statement.

#Purpose

Highlights field initialization statements, which can be removed to improve code readability.

#Example

private string _StringField = null;

Fix:

private string _StringField;