The follow are my java code
i want to enter: asd 123456 hellohello
output:
asd
123456
hellohello
However it come out error. anyone can help me?
package test;
import java.util.Scanner;
public class test1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner (System.in);
String cs = sc.next();
String[] output = cs.split("\\s+");
System.out.println(output[0]);
System.out.println(output[1]);
System.out.println(output[2]);
}
}