Homework2

1.findLast()函数,for循环中,i>0应该改为i>=0
lastZero()函数,for循环应该改为for(int i=x.length-1;i>=0;i--)

2.findLast()函数,x=null则不会执行fault
latsZero()函数总会执行fault

3.对于findLast(),test case:x=[2,3,5,2];y=2
对于lastZero(),test case:x=null
这样会执行fault但不会产生error。

4.对于findLast(),test case:x=[2],y=4
对于lastZero(),test case:x=[1,0,1]
这样会触发error但不会产生failure.

posted @ 2018-03-12 16:41  玉雪纷飞  阅读(145)  评论(0编辑  收藏  举报