首页 > 其他 > 详细

Homework 2

时间:2017-03-03 01:17:28      阅读:201      评论:0      收藏:0      [点我收藏+]
  • No.1

  1. Fault:
    for (int i=x.length-1; i > 0; i--)
    should be
    for (int i=x.length-1; i >= 0; i--)
  2. Test: x = NULL; y=1
    Expected: NullPointerException
    Actual: NullPointerException
  3. Test: x=[1, 2, 3]; y=3
    Expected is 2;
    Actual is 2;
  4. Test: x=[1, 2, 3]; y=4
    Expected is -1;
    Actual is -1;

 

  • No.2

  1. Fault
    for (int i = 0; i < x.length; i++)
    should be
    for (int i = x.length-1; i>=0; i--)
  2. Test: x=[ ];
    Expected: NullPointerException
    Actual: NullPointerException
  3. Test: x=[0];
    Expected is 0;
    Actual is 0;
  4. Test: x=[1, 2, 3];
    Expected is -1;
    Actual is -1;

Homework 2

原文:http://www.cnblogs.com/yuzhenhuan1996/p/6493188.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!