J
Jack Addington
in C# can I put a default value for a param in the declaration or do I need
to create two method calls? I have a method that 99% of the time I want to
pass false to but occasionally pass true. Do I have to have 2 methods?
i.e.)
public int testMethod(bool someParam default false)
{
....
}
instead of:
public int testMethod()
{
return testMethod( false );
}
public int testMethod( bool someParam )
{
...
}
thx
to create two method calls? I have a method that 99% of the time I want to
pass false to but occasionally pass true. Do I have to have 2 methods?
i.e.)
public int testMethod(bool someParam default false)
{
....
}
instead of:
public int testMethod()
{
return testMethod( false );
}
public int testMethod( bool someParam )
{
...
}
thx