nextchar in java

Java
char tempPref = get.next().charAt(0);Scanner scanner = new Scanner(System.in);
char ch = scanner.next().charAt(0);
Source

Also in Java: