0 votes

1 Answer

0 votes
by

How to scan string in java?

import java.util.*;

public class ScannerExample {

public static void main(String args[]){

Scanner in = new Scanner(System.in);

System.out.print(""Enter your name: "");

String name = in.nextLine();

System.out.println(""Name is: "" + name);

in.close();

🔗Reference : stackoverflow.com

🔗Source: Java Interview Questions and Answers

🔗Reference: Javatpoint.com

...