首页 > 试题广场 >

以下这段代码的圈复杂度为() 代码段如下:...

[不定项选择题]

以下这段代码的圈复杂度为()

   代码段如下:

     public String case2(int index, String string) {

       String returnString = null;

       if (index < 0) {

           throw new IndexOutOfBoundsException("exception <0 ");

       }

       if (index == 1) {

           if (string.length() < 2) {

              return string;

           }

           returnString = "returnString1";

       } else if (index == 2) {

           if (string.length() < 5) {

              return string;

           }

           returnString = "returnString2";

       } else {

           throw new IndexOutOfBoundsException("exception >2 ");

       }

       return returnString;

    }

  • 4
  • 5
  • 6
  • 7

这道题你会答吗?花几分钟告诉大家答案吧!