how would you encode this in java?
char c; int n; cin >> c >> n;
So, I can get these inputs:
X123123
You can use Scanner with System.in . For example.
Scanner
System.in
Scanner s = new Scanner(System.in); char c = s.findInLine(".").charAt(0); int n = s.nextInt();