考虑这段代码:
// Create a Item oject
item item = new item();
编译器错误信息:
错误 - 找不到符号 - 构造函数 item();
类item
:
public class item
{
// Attributes
private String Itemcode;
private String Itemname;
private String Description;
private String Style;
private String Finish;
private float Unitprice;
private float Stock;
private String Suppliercode;
private String Suppliername;
private String Address;
public item(String ItemcodeIn, String ItemnameIn, String DescriptionIn,
String StyleIn, String FinishIn, float UnitpriceIn, float StockIn,
String SuppliercodeIn,
String SuppliernameIn, String AddressIn)
{
Itemcode = ItemcodeIn;
Itemname = ItemnameIn;
Description = DescriptionIn;
Style = StyleIn;
Finish = FinishIn;
Unitprice = UnitpriceIn;
Stock = StockIn;
Suppliercode = SuppliercodeIn;
Suppliername = SuppliernameIn;
Address = AddressIn;
}
此代码之后是属性的所有 setter/getter 方法。
我该如何解决这个问题?