public void Timing(String a){
df=new SimpleDateFormat("HH:mm:ss"); //时间格式
try{
this.timeLength=df.parse("00:"+a+":00"); //更改传进来的参数为时间类型,赋给时间长度
} catch(ParseException e) {
e.printStackTrace();
}
}
改为
public Timing(String a){
df=new SimpleDateFormat("HH:mm:ss"); //时间格式
try{
this.timeLength=df.parse("00:"+a+":00"); //更改传进来的参数为时间类型,赋给时间长度
} catch(ParseException e) {
e.printStackTrace();
}
}去掉void,构造方法不需要
df=new SimpleDateFormat("HH:mm:ss"); //时间格式
try{
this.timeLength=df.parse("00:"+a+":00"); //更改传进来的参数为时间类型,赋给时间长度
} catch(ParseException e) {
e.printStackTrace();
}
}
改为
public Timing(String a){
df=new SimpleDateFormat("HH:mm:ss"); //时间格式
try{
this.timeLength=df.parse("00:"+a+":00"); //更改传进来的参数为时间类型,赋给时间长度
} catch(ParseException e) {
e.printStackTrace();
}
}去掉void,构造方法不需要
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货