用java写一个商家的实体类
时间: 2023-05-12 21:02:50 浏览: 140
好的,以下是一个简单的商家实体类的 Java 代码:
```
public class Merchant {
private String name;
private String address;
private String phone;
private double revenue;
public Merchant(String name, String address, String phone, double revenue) {
this.name = name;
this.address = address;
this.phone = phone;
this.revenue = revenue;
}
public String getName() {
return name;
}
public String getAddress() {
return address;
}
public String getPhone() {
return phone;
}
public double getRevenue() {
return revenue;
}
public void setName(String name) {
this.name = name;
}
public void setAddress(String address) {
this.address = address;
}
public void setPhone(String phone) {
this.phone = phone;
}
public void setRevenue(double revenue) {
this.revenue = revenue;
}
}
```
阅读全文