© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
3y ago
•
35 replies
Valwex
❔ Initializing an object
Hello
, what is the difference between these two lines
?
var p = new Point() { X = 42, Y = 13 };
var p = new Point() { X = 42, Y = 13 };
and
var p = new Point(42, 13);
var p = new Point(42, 13);
I know that the first allows you to initiate an object
, but I don
't understand the difference
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
✅ Object is null after initializing
C
C# / help
12mo ago
Object reference set to an instance of an object.
C
C# / help
3y ago
{} vs [] when initializing an array in C#
C
C# / help
13mo ago
✅ Object reference not set to an instance of an object.
C
C# / help
10mo ago