C# Programming Notes
C# Programming Notes
By Lihle Zulu
Objectives
Explain the
Explain the Arrays & String
purpose of System.Media
purpose of a manipulation
exception Namespace
nullable type. and methods
handling.
• a value type cannot be assigned a null
value. For example, int i = null will give
you a compile time error.
• C# 2.0 introduced nullable types that
allow you to assign null to value type
variables. You can declare nullable types
Nullable using Nullable<t>where T is a type.
Type • Nullable<int> i = null;
• A nullable type can represent the correct
range of values for its underlying value
type, plus an additional null value. For
example, Nullable<int> can be assigned
any value from -2147483648 to
2147483647, or a null value.
Nullable Type