Skip to main content
fixed formatting
Source Link
Mamta D
  • 6.5k
  • 3
  • 30
  • 43

GetValueOrDefault()

// GetValueOrDefault(), retrieves the value of the object. If it is null so, it returnreturns the default value of int , which is 0;0.

v2= v1.GetValueOrDefault();Example:

v2= v1.GetValueOrDefault();

// GetValueOrDefault(), retrieves the value of the object. If it is null so it return the default value of int , which is 0;

v2= v1.GetValueOrDefault();

GetValueOrDefault()

retrieves the value of the object. If it is null, it returns the default value of int , which is 0.

Example:

v2= v1.GetValueOrDefault();

Source Link

// GetValueOrDefault(), retrieves the value of the object. If it is null so it return the default value of int , which is 0;

v2= v1.GetValueOrDefault();