我很困惑为什么这不会运行.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication3
{
class Buyer : User
{
public void AuctionWon()
{
}
}
}
Run Code Online (Sandbox Code Playgroud)
我得到"不包含带0参数的构造函数".我事前已经寻求帮助,但没有结果有帮助.
这是用户类
public class User
{
private int accountNo;
private int password;
public User(int accountNo, int password)
{
this.accountNo = accountNo;
this.password = password;
}
public bool Validatepassword(int userpassword)
{
if (password == userpassword)
{
return true;
}
else
{
return false;
}
}
public int GetAccountNo()
{
return accountNo;
}
}
Run Code Online (Sandbox Code Playgroud)