That doesn't compile in 3.5 and I think the error message answers your question:
'daniweb.MyClass.MyClass()' must declare a body because it is not marked abstract, extern, or partial
'daniweb.MyClass.MyClass(string)' must declare a body because it is not marked abstract, extern, or partial
Interfaces allow you to declare methods similarly but the method must have a return type:
public interface ITest
{
void ITest();
}
I suspect you were looking at partial class definitions.
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
Either that or the methods were abstract.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
Either that or the methods were abstract.
You can't have abstract constructors since the child classes cannot implement constructors from an inherited class...
None of these are valid:
public abstract class AbstractClass
{
abstract AbstractClass();
}
public abstract class AbstractClass2
{
AbstractClass2();
}
public class AbstractClass3
{
abstract AbstractClass3();
}
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
You can't have abstract constructors since the child classes cannot implement constructors from an inherited class...
Obviously I wasn't talking about his code example because the methods there were not marked abstract.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177