+ 1
Can't I get string as input using this method
Scanner sc = new Scanner(System.in) String s = sc.nextLine();
3 Answers
+ 3
Scanner sc = new Scanner(System.in) ;
//ask question
String word = sc.nextLine();
//print it
System.out.println("user typed: " + word) ;
+ 1
Is there at first line:
import java.util.Scanner;
?
0
No it's not just a word