2 Answers
New AnswernextLine() is a method defined in Scanner class. It's used to take String input. Similarly, there are separate methods for taking int, double, boolean inputs (nextInt(), nextDouble(), nextBoolean() etc.) See the official documentation for more details: https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message