Update the Model
Right now, our model class has no place to hold the restaurant type. To change that, modify LunchList/src/apt/tutorial/Restaurant.java to add in a new private String type data member and a getter/setter pair, like these:
public String getType() {
return(type);
}
public void setType(String type) {
this.type=type;
}
When you are done, your restaurant class should look something like this:
package apt.tutorial;
public class Restaurant {
private String name="";
private String address="";
private String type="";
public String getName() {
return(name);
}
public void setName(String name) {
this.name=name;
}
public String getAddress() {
return(address);
}
public void setAddress(String address) {
this.address=address;
}
public String getType() {
return(type);
}
public void setType(String type) {
this.type=type;
}
}
public String getType() {
return(type);
}
public void setType(String type) {
this.type=type;
}
When you are done, your restaurant class should look something like this:
package apt.tutorial;
public class Restaurant {
private String name="";
private String address="";
private String type="";
public String getName() {
return(name);
}
public void setName(String name) {
this.name=name;
}
public String getAddress() {
return(address);
}
public void setAddress(String address) {
this.address=address;
}
public String getType() {
return(type);
}
public void setType(String type) {
this.type=type;
}
}
No comments:
Post a Comment