0
I’m programming in C# and I always see them use propriedades allowing to take and set the value of the variable, but what is the sense of this? When you let it just take the value or something I kind of understand, because it’s less work than creating a método to take this value, but when it is the simplest I do not understand. There is real difference between the two codes below?
public int Numero { get; set; }
public int numero;
You are free to abstract how you will rescue or how you will save the value. Not to mention that there may be frameworks that go after methods
gettersandsetters(the existence of these frameworks is too common in Java, I don’t know as much as C#)– Jefferson Quesado
Really, I was using
SQLite.netforXamarinand to use some features like autoincrement, if I’m not mistaken, you need togetterandsetter.– underfilho