Default Values of Variables in C#

C# Default Values ​​of Variables

If we do not assign a value to a variable that we have defined in the C# programming language, a default value is automatically assigned to that variable. This default value assigned depends on the type of variable. 

The default value is 0 for integer types, and 0.0 for decimal numbers. 

Click on the link below to review the default values ​​of all variable types.

http://msdn.microsoft.com/en-us/en/library/83fhsxwc.aspx

When the table is examined, it will be seen that there is no default value for the String type. String variables are null by default, meaning they have no value.

C# Default Values of Variables, value of a variable when empty, variables default values, string default value

EXERCISES

There are no examples related to this subject.



COMMENTS




Read 1444 times.

Online Users: 282



default-values-of-variables