Unhandled exception type ParseException

1、当编辑器提示:Unhandled exception type ParseException异常的时候,说明在该方法中抛出Exception异常,但是没有进行相关处理功能。

2、解决方法:对该方法进行try{} catch{} 异常处理。

public static void main(String[] args) { String[][] t = new String[13][6]; t[0] = new String[]{"悉尼","13512345678","2023-06-12","2023-06-20","飞机","2"}; t[1] = new String[]{"上海","1351234567c","2023-06-12","2023-06-20","飞机","2"}; t[2] = new String[]{"上海","1351234567","2023-06-12","2023-06-20","飞机","2"}; t[3] = new String[]{"上海","23512345678","2023-06-12","2023-06-20","飞机","2"}; t[4] = new String[]{"上海","13512345678","2023-06-2","2023-06-20","飞机","2"}; t[5] = new String[]{"上海","13512345678","2023-06-12","2023-06-11","飞机","2"}; t[6] = new String[]{"上海","13512345678","2023-06-12","2023-06-20","飞机","2"}; t[7] = new String[]{"上海","13512345678","2023-06-12","2023-06-20"," ","2"}; t[8] = new String[]{"上海","13512345678","2023-06-12","2023-06-20","自驾","-1"}; t[9] = new String[]{"上海","13512345678","2023-06-12","2023-06-20","火车","2.5"}; t[10] = new String[]{"上海","13512345678","2023-06-12","2023-06-20","自驾","2"}; t[11] = new String[]{"上海","13512345678","2023-06-12","2023-06-20","火车","2"}; t[12] = new String[]{"上海","13512345678","2023-06-12","2023-06-20","飞机","0"}; String[] a={"出差地无效","联系电话无效","联系电话无效","联系电话无效","日期无效", "日期无效","日期无效","出行方式无效","同行人数无效","同行人数无效","提交申请","提交申请","提交申请"}; String expected,actual,result; System.out.println("编号"+"\t"+"出差地"+"\t"+"联系电话"+"\t"+"开始日期"+"\t"+"结束日期"+"\t"+"出行方式"+"\t"+"同行人数"+"\t"+"预期输出"+"\t"+"实际输出"+"\t"+"测试结果"); for(int i=0;i<=12;i++){ expected=a[i]; actual=application(t[i][0],t[i][1],t[i][2],t[i][3],t[i][4],t[i][5]); if(expected.equals(actual)) result="Passed"; else result="Failed"; System.out.println("T["+(i+1)+"]"+"\t"+t[i][0]+"\t"+t[i][1]+"\t"+t[i][2]+"\t"+t[i][3]+"\t"+t[i][4]+"\t"+t[i][5]+"\t"+expected+"\t"+"\t"+actual+"\t"+result); } } }如何处理Unhandled exception type ParseException
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值