T
Tom P.
I am writing a class with several constructors and don't want to
repeat the code. How can I call a constructor from another
constructor?
Example:
class Foo
{
public Foo(string FName, string LName)
{
...some code ...
}
public Foo(string FName)
{
Foo(FName, String.Empty);
}
}
I keep getting "Foo is a type but is used like a variable" errors.
How do I implement this?
Tom P.
repeat the code. How can I call a constructor from another
constructor?
Example:
class Foo
{
public Foo(string FName, string LName)
{
...some code ...
}
public Foo(string FName)
{
Foo(FName, String.Empty);
}
}
I keep getting "Foo is a type but is used like a variable" errors.
How do I implement this?
Tom P.