How to use scanner class and how to enter the variable for input | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to use scanner class and how to enter the variable for input

7th Sep 2018, 3:52 PM
Mukesh
2 Answers
+ 8
import java.util.Scanner; public class App{ public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.println("Enter Word: "); String userAnswer = input.nextLine(); } }
7th Sep 2018, 3:57 PM
Naola
Naola - avatar
0
hi
7th Sep 2018, 3:57 PM
Mukesh