I have to make a loop taking a users input until “done” is entered

前端 未结 4 1220
被撕碎了的回忆
被撕碎了的回忆 2020-12-20 01:53

I\'m trying to make an ArrayList that takes in multiple names that the user enters, until the word done is inserted but I\'m not really sure how.

4条回答
  •  一向
    一向 (楼主)
    2020-12-20 02:21

    String[] inputArray = new String[0];
    do{
      String input=getinput();//replace with custom input code
      newInputArray=new String[inputArray.length+1];
      for(int i=0; i

    untested code, take it with a grain of salt.

提交回复
热议问题