Scanner.next() and Scanner.nextLine()

前端 未结 3 1131
不思量自难忘°
不思量自难忘° 2021-01-28 15:10

I have the following code:

Scanner in = new Scanner (System.in);
String[] data = new String[5];

System.out.println(\"Please, enter the name of the customer orde         


        
3条回答
  •  难免孤独
    2021-01-28 16:04

    next() -- Finds and returns the next complete token from this scanner nextLine() --Advances this scanner past the current line and returns the input that was skipped.

    From the java API documentation.

提交回复
热议问题