class Class1
{
public Class1(int i) { }
}
class Class2 : Class1
{
public Class2(int i, String s, boolean tf)
{
// ??? how do you call Class1's constructor?
}
}
How do yo call a base classes constructor in c#?
Yeah, the 'base' keyword is the base class, similar to the 'this' keyword being the current class.
Reply:In the method signature:
public Class2(int i, String s, boolean tf) : base(i)
{
//do stuff here
}
nobile
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment