美文网首页cse142
token-based file processing 中 if

token-based file processing 中 if

作者: Juncaceae | 来源:发表于2018-03-09 11:13 被阅读0次

    final题目,如下:

    报错版本如下:

    NoSuchElementException error (�read past the end of the input) --> ??  知道为什么报这个错了 - token五个;这个写法读取的是偶数/pairs,所以读完uw,token已经结束,但是第二个if statement 还在执行 --> 有空再对比正确版本 细排一下流程图/逻辑

    修改后能运行版本如下:

    似乎是条件判断的问题?在条件判断里call input.next( ) 会advance cursor吗?为什么报错是no such element error? How does the program read past the input??? 

    --------------------

    新例子,call scanner method next( ) inside of a if statement, seems it works! 

    so what is wrong with the previous example? 

    相关文章

      网友评论

        本文标题:token-based file processing 中 if

        本文链接:https://www.haomeiwen.com/subject/zydpfftx.html