Hi Sumit,
First of all there's only
get
in the code above (did I miss the
set
?)
And regarding the get itself:
When you access the property for reading the
get
method is invoked and the code runs inside until it reached the
return
keyword.
Same goes for
set
, if you try to write a value to the property.
see
get&set in a msdn [
^] article.
To edit a specific cell of the ArrayList USStates, simply use:
USStates[0] = new USState("MyInventedState", "IS");
and for example to work with it:
USState state = USSTates[0];
string longName = state.LongName;
Cheers,
Edo