主题:关于构造函数的问题
namespace MyApplication
{
public class output1 : output
{
//private char i;
//public output1(char from, char to)
//{
// f = from;
// t = to;
//}
public override string myresult()
{
for (i = t; i >= f; i--)
{
str = str + i;
}
return str;
}
}
public class output
{
protected char i, f, t;
//private char i;
public output(char from, char to)
{
f = from;
t = to;
}
public virtual string myresult()
//public string myresult()
{
//str="";
for (i = f; i <= t; i++)
{
str = str + i;
}
return str;
}
}
}
}
会说No overload for method 'output' takes '0' arguments的错误.因改是构造函数OUTPUT的问题.如何解决呢?
{
public class output1 : output
{
//private char i;
//public output1(char from, char to)
//{
// f = from;
// t = to;
//}
public override string myresult()
{
for (i = t; i >= f; i--)
{
str = str + i;
}
return str;
}
}
public class output
{
protected char i, f, t;
//private char i;
public output(char from, char to)
{
f = from;
t = to;
}
public virtual string myresult()
//public string myresult()
{
//str="";
for (i = f; i <= t; i++)
{
str = str + i;
}
return str;
}
}
}
}
会说No overload for method 'output' takes '0' arguments的错误.因改是构造函数OUTPUT的问题.如何解决呢?