java take string input from user and split code example
Example: java string split from input string
String line = scann.nextLine();
String[] info = line.split(" ");
for( String s : info) {
System.out.println(s);
}
String line = scann.nextLine();
String[] info = line.split(" ");
for( String s : info) {
System.out.println(s);
}