文章标题

本文介绍了一个用于存储和管理一天中天气信息的Java类。该类包括位置、日期、温度等属性,并提供了获取和设置这些属性的方法。此外,还提供了一个toString()方法用于输出对象的所有信息。

测试博客内容:

public class OneDayWeatherInf {
     //这是一个变量  
     String location;  
     String date;    
     String week;    
     String tempertureOfDay;    
     String tempertureNow;    
     String wind;    
     String weather;     
     String picture;    
     int pmTwoPointFive;    

 public OneDayWeatherInf(){    

     location = "";    
     date = "";    
     week = "";    
     tempertureOfDay = "";    
     tempertureNow = "";    
     wind = "";    
     weather = "";    
     picture = "undefined";    
     pmTwoPointFive = 0;    
 }    



 public String getLocation() {    
     return location;    
 }    
 public void setLocation(String location) {    
     this.location = location;    
 }    
 public String getDate() {    
     return date;    
 }    
 public void setDate(String date) {    
     this.date = date;    
 }    
 public String getWeek() {    
     return week;    
 }    
 public void setWeek(String week) {    
     this.week = week;    
 }    
 public String getTempertureOfDay() {    
     return tempertureOfDay;    
 }    
 public void setTempertureOfDay(String tempertureOfDay) {    
     this.tempertureOfDay = tempertureOfDay;    
 }    
 public String getTempertureNow() {    
     return tempertureNow;    
 }    
 public void setTempertureNow(String tempertureNow) {    
     this.tempertureNow = tempertureNow;    
 }    
 public String getWind() {    
     return wind;    
 }    
 public void setWind(String wind) {    
     this.wind = wind;    
 }    
 public String getWeather() {    
     return weather;    
 }    
 public void setWeather(String weather) {    
     this.weather = weather;    
 }    
 public String getPicture() {    
     return picture;    
 }    
 public void setPicture(String picture) {    
     this.picture = picture;    
 }    
 public int getPmTwoPointFive() {    
     return pmTwoPointFive;    
 }    
 public void setPmTwoPointFive(int pmTwoPointFive) {    
     this.pmTwoPointFive = pmTwoPointFive;    
 }    

 public String toString(){    

     return location+"   "+date+"   "+week+" tempertureOfDay:  "+tempertureOfDay+" tempertureNow:  "+tempertureNow+"   "+wind+"   "+weather+"   "+picture+"   "+pmTwoPointFive;    
 }     
}
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值