承包商的错误。为什么? [英] The errors in contractor. Why?
本文介绍了承包商的错误。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
错误显示此行(base(讲义,名称))..为什么?
The Error showing this line (base(lectureId,name) )..why?
namespace XYZ_System
{
class FullTimeLectureClass : Lecturer
{
private double basicSalary;
public Double _basicSalary
{
get { return basicSalary; }
set { basicSalary = value; }
}
private Double allowance;
public Double _allowance
{
get { return allowance; }
set { allowance = value; }
}
public FullTimeLectureClass():base(){ }
public FullTimeLectureClass(Double basicsalary):base(lectureId,name)
{
this._basicSalary = basicsalary;
this._allowance = GetAllowance();
}
这是我的基类
this is my base class
namespace XYZ_System
{
public class Lecturer
{
private int lectureId;
public int _lectureId
{
get { return lectureId; }
set { lectureId = value; }
}
private String name;
public String _name
{
get { return name; }
set { name = value; }
}
private String email;
public String _email
{
get { return email; }
set { email = value; }
}
private int mobileNo;
public int _mobileNo
{
get { return mobileNo; }
set { mobileNo = value; }
}
private int landNo;
public int _landNo
{
get { return landNo; }
set { landNo = value; }
}
private String status;
public String _status
{
get { return status; }
set { status = value; }
}
private String address;
public String _address
{
get { return address; }
set { address = value; }
}
private String gender;
public String _gender
{
get { return gender; }
set { gender = value; }
}
private Double salary;
public Double _salary
{
get { return salary; }
set { salary = value; }
}
//constrator
public Lecturer()
{
}
public Lecturer(int id) //Custom Constructor - overloaded
{
this.lectureId = id;
}
public Lecturer(int lectureId, String name, String email, int mobileNo, int landNo, String status, String address, String gender, Double salary)
{
this.lectureId = lectureId;
this.name = name;
this.email = email;
this.mobileNo = mobileNo;
this.landNo = landNo;
this.status = status;
this.address = address;
this.gender = gender;
this.salary = salary;
}
我的尝试:
i已创建基类和子类..在子类中显示错误。此行中的错误
public FullTimeLectureClass(Double basicsalary ):base(lectureId,name)
What I have tried:
i have created base class and child class.. there is an error showing in child class.the errors in this line
public FullTimeLectureClass(Double basicsalary):base(lectureId,name)
推荐答案
Quote:
base(lectureId ,name)
base(lectureId,name)
你的基类中没有这样的构造函数(带两个参数)。
这篇关于承包商的错误。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文