0
Can anyone tell me any simple method of using scanner
Can anyone tell me any simple method of using scanner in java to get input from a user because the one in tutorial is very complex
2 Answers
+ 3
//this is simplest way consume less lines and less declaration.
import java.util.Scanner;
class MyClass {
public static void main(String[] args) {
String input = new Scanner(System.in).nextLine();
System.out.println(input);
}
}