I'm trying to learn Visual C#.net. If you are creating a class that is going to have an array in it must you use get and set methods. Or is there a different way it should be handled. This is a console program.
Thanks Augie
I'm trying to learn Visual C#.net. If you are creating a class that is going to have an array in it must you use get and set methods. Or is there a different way it should be handled. This is a console program.
Thanks Augie
using getters and setters is recommend. Infact, it's the de facto standard for most C# developers. getters and setters are pretty much like methods because their assembly is identical to one, but if it's a simple set and get, then they are inlined. You could use methods, but then that defeats the purpose of getters and setters, right? Methods, on the other hand are looked at as functions that "act" on the data in the same class it's in. They change the state of an object through the help of set's and get's.
As for the array inside the class situation; I personally would probably use an indexer (get and set functionality).
xeddiex.