i just need to know what is the difference between these two lines
private string somestring => "string";
private string somestring = "string";
what is the difference of there uses they just prints same to the console
i just need to know what is the difference between these two lines
private string somestring => "string";
private string somestring = "string";
what is the difference of there uses they just prints same to the console
private string somestring => "string";
This is an expression-bodied property, and is equivalent to the following:
private string somestring { get { return "string"; } }
Whereas the following is just a regular field:
private string somestring = "string";
See this related question on Properties vs Fields for more information.