try、catch语法html
学习8.1.1时,看到try、catch捕捉错误的案例,书中只捕捉了一个错误,若是有多个错误该如何捕捉?前端
try{ 事情... }catch(IOException | InterruptedException | ClassCastException e) { e.printStackTrace(); }
import java.util.Scanner; public class Fibonacci { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int x = 0; int[] Fi = new int[51]; Fi[0] = 0; Fi[1] = 1; System.out.println("求几个费式数?(50之内)"); int num = scanner.nextInt(); if (num >= 2) { for (int j = 2; j < num; j++){ Fi[j] = Fi[j - 1] + Fi[j - 2]; } } for (int i = 0; i < num; i++){ System.out.printf("%3d;",Fi[i]);x++; if (x == 5){ System.out.println(); x = 0; } } } }
public Test() throws RepletException { try { System.out.println("Test this Project!") } catch (Exception e) { throw new Exception(e.toString()); } }
这周又接触到了没接触过的新知识、新概念。不过凡事都讲究个基本功,感受要是前面这些的基础知识学的不透彻不理解,后面就更别说了,确定愈来愈难,好好学!java
代码行数(新增/累积) | 博客量(新增/累积) | 学习时间(新增/累积) | 重要成长 | |
---|---|---|---|---|
目标 | 5000行 | 30篇 | 400小时 | |
第一周 | 200/200 | 2/2 | 20/20 | |
第二周 | 300/500 | 2/4 | 18/38 | |
第三周 | 500/1000 | 3/7 | 22/60 | |
第四周 | 300/1300 | 2/9 | 22/90 | |
第五周 | 486/1300 | 2/9 | 21/90 |
尝试一下记录「计划学习时间」和「实际学习时间」,到期末看看能不能改进本身的计划能力。这个工做学习中很重要,也颇有用。 耗时估计的公式 :Y=X+X/N ,Y=X-X/N,训练次数多了,X、Y就接近了。git
参考:软件工程软件的估计为何这么难,软件工程 估计方法程序员
计划学习时间:XX小时编程
实际学习时间:XX小时设计模式
改进状况:架构
(有空多看看现代软件工程 课件 软件工程师能力自我评价表)ide