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

0

Is nextLine a keywords??

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

5/23/2019 3:13:10 AM

siri sa

2 Answers

New Answer

+9

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: https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html

+1

Thank uShamima Yasmin