Java equivalent of cin (C++)

You can use Scanner with System.in. E.g.

Scanner s = new Scanner(System.in);
char c = s.findInLine(".").charAt(0);
int n = s.nextInt();

Leave a Comment