6个属性封装成一个类。

package cn.itcast.weather;
public class WeatherInfo {
private String id;
private String temp;
private String weather;
private String name;
private String pm;
private String wind;
public String getId(){
return id;
}
public void setId(String id){
this.id=id;
}
public String getTemp(){
return temp;
}
public void setTemp(String temp){
this.temp=temp;
}
public String getWeather(){
return weather;
}
public void setWeather(String weather){
this.weather=weather;
}
public String getName(){
return name;
}
public void setName(String name){
this.name=name;
}
public String getPm(){
return pm;
}
public void setPm(String pm){
this.pm=pm;
}
public String getWind(){
return wind;
}
public void setWind(String wind){
this.wind=wind;
}

}

你可能感兴趣的:(初学者)