Endless loop while using “try and catch ” block inside a “while loop”

前端 未结 4 960
眼角桃花
眼角桃花 2020-12-21 21:56

My program has an endless loop, when I use try and catch block in a while loop.

import java.util.*;
class Try
{
    public          


        
4条回答
  •  渐次进展
    2020-12-21 22:49

    You did not break the loop. To end the loop you need to insert

    break;
    

    wherever you would like the loop to end.

提交回复
热议问题