© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•11mo ago•
18 replies
Faker

✅ Is there a difference when we use { get; init; } vs { get; } ?

public record Person
{
    public required string FirstName { get; init; }
    public required string LastName { get; init; }
};
public record Person
{
    public required string FirstName { get; init; }
    public required string LastName { get; init; }
};


Hello guys, if I omit the
init
init
keyword here, would it make a difference? From what I've understood with or without the
init
init
keyword, we would still be able to "modify" the object during instantiation, no?
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

✅ Caching with IMemoryCache, is there a difference?
C#CC# / help
3y ago
✅ When will we use overload method?
C#CC# / help
3y ago
When to use Databases vs Filesystem Storage
C#CC# / help
4y ago
When should we use immutable data structures?
C#CC# / help
4y ago