What is the purpose of <List<T>?>

jessethepro

New member
Joined
May 15, 2024
Messages
2
Programming Experience
5-10
I do not understand the use of the "?" operator in this context.

Thanks,
Jesse
 
The question mark is not an operator in that context. It is an annotation indicating that a null reference to a List<T> is valid. It is syntactic sugar for Nullable<List<T>>.

It is the same as the case of a int? is basically Nullable<int>.
 
Ahh Thank you. I could see the Null reference in the documentation but given its position it was hard to tell which object could be null.
 

Latest posts

Back
Top Bottom