Can single String contain multiple lines?

后端 未结 2 1690
一生所求
一生所求 2021-01-25 23:33

For example if I assign multiple lines to a string as so:

while ((line = reader.readLine()) != null)
        {
            output += line + \"\\n\";
        }
         


        
2条回答
  •  情书的邮戳
    2021-01-25 23:45

    why not just move this to outside the while loop?

        System.out.print("Enter your choice: ");
        fromClient = stdIn.readLine().trim();
    

提交回复
热议问题