Re: Inheritance of constructors.
- From: A n g l e r <p|k|o|n|i|u|s|z@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Jun 2008 18:04:14 +0100
class Test
{
static void Main()
{
string[] x = {"Jon", "Holly"};
Foo foo = new Foo(x);
foo.ShowNames();
x[0] = "Robin";
x[1] = "William";
foo.ShowNames();
}
}
And what now happens if you wanted to add yet another field? You'd have to write x = {"bla", "bla", "bla"} which results in a new reference by value that isn't passed to Foo. OK, you may go for some more advanced container of objects where you can add/delete all stuff by appropriate methods, though this suddenly becomes more and more elaborate while with means of memory-wise reference you could replace the whole array easily if needed.
.
- Follow-Ups:
- Re: Inheritance of constructors.
- From: Jon Skeet [C# MVP]
- Re: Inheritance of constructors.
- References:
- Inheritance of constructors.
- From: A n g l e r
- Re: Inheritance of constructors.
- From: Jon Skeet [C# MVP]
- Re: Inheritance of constructors.
- From: A n g l e r
- Re: Inheritance of constructors.
- From: Jon Skeet [C# MVP]
- Re: Inheritance of constructors.
- From: A n g l e r
- Re: Inheritance of constructors.
- From: A n g l e r
- Re: Inheritance of constructors.
- From: Jon Skeet [C# MVP]
- Re: Inheritance of constructors.
- From: A n g l e r
- Re: Inheritance of constructors.
- From: Jon Skeet [C# MVP]
- Re: Inheritance of constructors.
- From: A n g l e r
- Re: Inheritance of constructors.
- From: Jon Skeet [C# MVP]
- Inheritance of constructors.
- Prev by Date: Re: csc or al
- Next by Date: Readonly locals?
- Previous by thread: Re: Inheritance of constructors.
- Next by thread: Re: Inheritance of constructors.
- Index(es):
Relevant Pages
|