I'm looking at some C# intro stuff, and they say you can return a value from a method, and that you can specify ?:Normally, from my understanding, you use ? to say the variable can be set to null (but apparently you can't use it on strings, even though they didn't say why):Code:class Foo { byte? Bar() { return 0xFF; } }So why am I specifying a ? on a method value? To say that I might be returning null, or so that I can assign my return value to something previously specified as having ??Code:int? foo = null;They're not clear on why I would want to be able to add a ? to my method's return type.Code:byte? b; b = Foo.Bar();
Quzah.