© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
12 replies
Matt

❔ What is the difference between these two pieces of code?

static PlayerHandler HPlayer => Program.HPlayer;
static PlayerHandler HPlayer => Program.HPlayer;

static PlayerHandler HPlayer = Program.HPlayer;
static PlayerHandler HPlayer = Program.HPlayer;

In essence I'm asking what the purpose of the lambda is here? I've used this pattern to help with a loose singleton pattern for a long time but I have no idea what this is even doing or why I use => over =
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

What's the difference between these two libraries? [Answered]
C#CC# / help
4y ago
❔ Difference between these variants
C#CC# / help
3y ago
❔ what is difference between _ and ()?
C#CC# / help
3y ago