Why `where T: class`

I am reading a book on c# 12. In this example the author includes where T: class but why is that needed?

It seems to work fine without
image.png
Was this page helpful?