I am working on a method that will count the number of tokens in a string, specifically integers. However, i'm finding that for some reason it is running endlessly even though there are only a small amount of tokens in the given string. I have a feeling given the small amount of code it is a conceptual misunderstanding somewhere on my part. Below is the method in question, any direction would be appreciated!
public static void countNumbers(String numstring)
int numbers = 0;
Scanner input = new Scanner(numstring);
while ( input.hasNext() )