0

I know we can define properties like this:

public int TemperatureC { get; set; }

But i've seen this:

public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);

this just works, is this the same as:

public int TemperatureF { get { return 32 + (int)(TemperatureC / 0.5556)}};

? I suppose there is not set in this case.

Nmaster88
  • 1,405
  • 2
  • 23
  • 65

1 Answers1

1

Yes, it is the same. You can read more here and here as suggested by @BurnsBA.

Corentin Pane
  • 4,794
  • 1
  • 12
  • 29