Hi, I am new to java and want to play around, I want to make a program that takes in input of lets say 5 numbers, and displays them separated by a space. For example I would enter 12345 and 1 2 3 4 5 would be returned.
this is what i have so far
package split;
import java.util.Scanner;
/**
*
* @author gabec94
*/
public class split {
public static void main(String[] args) {
System.out.printf("Enter a five digit number: ");
Scanner input = new Scanner(System.in);
String inputnumber = input.next();
inputnumber = inputnumber.split("\t \t \t \t");
System.out.printf("%s", splitnumber);
i was hoping to use the \t as tabs between each number netered, but i get errors, and cannot solve the problem. Any help is appreciated. Thanks.