Is nextLine a keywords?? | Sololearn: Learn to code for FREE!


Is nextLine a keywords??

import java.util.Scanner; class MyClass { public static void main(String[ ] args) { Scanner myVar = new Scanner(; System.out.println(myVar.nextLine()); } }

5/23/2019 3:13:10 AM

siri sa

2 Answers

New Answer


nextLine() 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:


Thank uShamima Yasmin