this should help you. it asks user to type in 4 digits which is first stored as a string.
then the parseInt and charAt etc. applies the first character of the string to variable 'number1', the 2nd character of the string to variable 'number2' etc. etc.
import java.util.Scanner;
public class StringtoInt {
public static void main(String[] args) {
String input;
int number1, number2, number3, number4;
Scanner scan = new Scanner(System.in);
System.out.println("Enter 4 digits: ");
input = scan.nextLine();
number1 = Integer.parseInt(String.valueOf(input.charAt(0)));
number2 = Integer.parseInt(String.valueOf(input.charAt(1)));
number3 = Integer.parseInt(String.valueOf(input.charAt(2)));
number4 = Integer.parseInt(String.valueOf(input.charAt(3)));
}
}
Hope this helps.