C#
C#

help

Root Question Message

v_v
v_v3/13/2023
Classes question in c#

what does the
 public Point(int x, int y) => (X, Y) = (x, y);
do in the code features on microsofts site
Jimmacle
Jimmacle3/13/2023
they're using tuples for what looks like the sole purpose of making the constructor a one-liner: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-tuples
Jimmacle
Jimmacle3/13/2023
so it's practically the same as
public Point(int x, int y)
{
  X = x;
  Y = y;
}
v_v
v_v3/13/2023
oh ok thanks
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy