以下这段代码的圈复杂度为()
代码段如下:
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;
}
