我的节目是游戏策划者的消遣。当您输入三个或更少的字符而不是必需的四个字符时,我试图防止错误,但是我的尝试/捕获只是.什么都没做。include spaces in your submission."); } catch(StringIndexOutOfBoundsExceptionBufferedReader br = new BufferedReader(ne
我正在做一些编码bat练习,我不太明白for-循环中发生了什么。public static int countHi(String str){
// While i is less than the length of如果我将其更改为仅str.Length,则会得到一个错误:线程"main“java.lang.StringIndexOutOfBoundsException中的异常: String索引超出范围:5