split function when it is an user input in java 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);
}