K
K Viltersten
Can someone, please, tell me what is wrong
with this code?! I get stuck on the "set"
method of the property.
public class Start
{[STAThread]
public static void Main ()
{ Something some1 = new Something ();
Something some2 = some1.doSome (); }}
class Something
{public Something () : this (1) { }
public Something (Something p) : this (p.Some) { }
public Something (byte s) { this.Some = s; }
public byte Some
{ get { return this.Some; }
set { this.Some = value; }}
public Something doSome ()
{ return new Something (2); }}
The program runs well when i use the default
definition of get/set as:
public byte Some { get; set; }
but one certainly need to be able to affect
what's being done there. I've been looking at
this for a few days. Either i'm slow or blind,
i can't see the error!
with this code?! I get stuck on the "set"
method of the property.
public class Start
{[STAThread]
public static void Main ()
{ Something some1 = new Something ();
Something some2 = some1.doSome (); }}
class Something
{public Something () : this (1) { }
public Something (Something p) : this (p.Some) { }
public Something (byte s) { this.Some = s; }
public byte Some
{ get { return this.Some; }
set { this.Some = value; }}
public Something doSome ()
{ return new Something (2); }}
The program runs well when i use the default
definition of get/set as:
public byte Some { get; set; }
but one certainly need to be able to affect
what's being done there. I've been looking at
this for a few days. Either i'm slow or blind,
i can't see the error!