© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
7 replies
Jason_Bjorn

Why `where T: class`

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

It seems to work fine without
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ ✅ WPF Class derivation where both classes have XAML pages
C#CC# / help
3y ago
❔ Why .Where() doesn't work with .Include()?
C#CC# / help
3y ago
❔ Why hasn't my class implemented the interface?
C#CC# / help
4y ago
✅ Where a can learnSqlCommand Class
C#CC# / help
13mo ago