面向对象
class shangpin 定义类 { string id; string name; double jiage; string chandi; public shangpin() { { public shangpin(string id, string name) } this id =id; this name = name; { public string Id } get { return id; } } public string Name { get { return name; } set { name=value; } 定义一个方法 public string show () { return"商品编号:" + id.ToString() + "商品名称:" + name + "商品价格:" + price; }
没写完 不知道怎么写了 ORZ