for example, i have the string "12,456,544,233" from the user input,
I want to take each number that is separated by commas and push each one into a Stack, converting it to an int in the process because the Stack is . (array implementation of a stack by the way)
So 12 would be at 0, 456 at 1, 544 at 2, etc...
I KNOW I have to use the Integer class to parse, but just not sure how to setup the loop to do everything, if i didn't provide enough info, ask and I will do so! thanks.
The code I tried:
String input = scan.nextLine();
stack.push(Integer.parseInt(String.valueOf(input.charAt(2))));