So you're writing some code and you need to check for a null value.
You'd write something like this, right?
string MyName;
if (GivenName == null)
MyName = "Lyle Kelly";
else
MyName = GivenName;
Great, it does exactly what we want right? Well, it does but it's a little bit long winded, why not like this then?
string MyName = (GivenName == null) ? "Lyle Kelly" : GivenName;
That's good, we've condensed it down to one line, but it could still be better. How about we do this instead then?
string MyName = GivenName ?? "Lyle Kelly";
There, isn't it pretty. So, what have we just done. Well we've just used the null coalescing operator. Which checks for a null value and sets a default value if a null value is found.
So in the example above it's checking the variable GivenName and if it's not null then set MyName to be GivenName, otherwise (if it is null) set MyName to be the string "Lyle Kelly". Simple.