You could take the first character from Scanner.next:

char c = reader.next().charAt(0);

To consume exactly one character you could use:

char c = reader.findInLine(".").charAt(0);

To consume strictly one character you could use:

char c = reader.next(".").charAt(0);
Answer from Reimeus on Stack Overflow
🌐
CodeGym
codegym.cc › java blog › java io & nio › is there nextchar() in scanner class in java?
Is there nextChar in Scanner Class in Java?
October 11, 2023 - If you’re looking to take char ... class. The best and most simple alternative to taking char input in Java would be the next().charAt(0)....
Discussions

How to input char in java using scanner?
Now you use charAt(0) to get the first character of that input string as a character. Always remember that sc.next() returns a String whereas charAt() returns a char. Hope that makes sense now :) ... There is not a method by the name `nextChar()` in Scanner class. It is a design policy for the language I suppose. https://tutorialspoint.dev/language/java... More on sololearn.com
🌐 sololearn.com
3
2
Write down the syntax to input a character through scanner class with an example.
Write down the syntax to input a character through scanner class with an example. More on knowledgeboat.com
🌐 knowledgeboat.com
1
127
February 10, 2021
java won't wait for my String user input before trying to convert it to a char variable.
The problem is closing the scanner and then creating a new one. Once a scanner with ‘System.in’ is closed, user input can’t be read. Just keep the same scanner throughout, saving the inputs to variables when needed. More on reddit.com
🌐 r/javahelp
5
2
November 1, 2023
Using Scanner to get a full string
It seems that you are having problems with java.util.Scanner The wiki here has a page The Scanner class and its caveats that explains common problems with the Scanner class and how to avoid them. Maybe this can solve your problems. Please do not reply because I am just a bot, trying to be helpful. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/javahelp
7
1
February 24, 2024
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › Java-Scanner-char-input-example
Java Scanner char input example without nextChar
Use an empty delimiter and charAt(0) to process user input one character at a time without a nextChar method. ... The Java Scanner class provides methods that take String input and convert that String into any Java primitive type you might need, ...
Published: September 10, 2025
🌐
Baeldung
baeldung.com › home › java › java io › java scanner taking a character input
Java Scanner Taking a Character Input | Baeldung
January 8, 2024 - We can similarly use the charAt() method to get the character value: @Test public void givenInputSource_whenScanCharUsingUseDelimiter_thenOneCharIsRead() { Scanner sc = new Scanner(input); char c = sc.useDelimiter("").next().charAt(0); ...
🌐
W3docs
w3docs.com › home › code snippets › java › take a char input from the scanner
Take a char input from the Scanner | W3docs
import java.util.Scanner; public ... a character: "); String input = scanner.nextLine(); char c = input.charAt(0); System.out.println("You entered: " + c); } }...
🌐
Quora
quora.com › How-do-I-accept-a-character-in-Java-using-scanner-class
How to accept a character in Java, using scanner class - Quora
Answer (1 of 4): Hello, Thanks for A2A Swach R. The Scanner class does not define any direct method to get a char input. You can use charAt() method to get first char from your input. example : [code]import java.util.Scanner; class ip { public static void main(String[] args) { S...
Find elsewhere
🌐
Electro4u
electro4u.net › blog › take-characters-as-input-with-java-scanner--1393
Take Characters as Input With Java Scanner
This method reads the next character ... ... import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // Read a single character String ch = sc.next(); // Print the character System.out.println("You entered: " + ch); } }...
🌐
YouTube
youtube.com › watch
How to take char based Input with a Java Scanner without a nextChar method - YouTube
How do you take char input from the Scanner class when it doesn't have a nextChar method? Well, you create your own.It's not hard to have the Scanner take Ja...
Published: July 17, 2022
🌐
Just Academy
justacademy.co › blog-detail › how-to-get-char-input-in-java
How to Get Char Input in Java by Roshan Chaturvedi | JustAcademy
This can be handy for implementing menu systems, handling specific key presses, or processing text character by character. You can get char input in Java by using methods like Scanner next().charAt(0) to read the first character of a string ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › scanner-class-in-java
Scanner Class in Java - GeeksforGeeks
import java.util.Scanner; // Driver ... System.out.println("Enter your gender (M/F): "); // Character input char gender = sc.next().charAt(0); // Numerical data input // byte, short and float can be read System.out.println("Enter ...
Published: May 27, 2026
🌐
Edureka Community
edureka.co › home › community › categories › java › is it possible to take char input from scanner
Is it possible to take char input from scanner | Edureka Community
April 27, 2018 - 2379/is-it-possible-to-take-char-input-from-scanner ... I have created a code in java for a flower shop and now my IDE is showing all the inputs are in red showing there is an error Jul 6, 2024
🌐
Quora
quora.com › How-do-I-get-a-character-array-as-an-input-using-a-scanner-class-in-Java
How to get a character array as an input using a scanner class in Java - Quora
Quora is a place to gain and share knowledge. It's a platform to ask questions and connect with people who contribute unique insights and quality answers.
🌐
CodingTechRoom
codingtechroom.com › tutorial › java-java-scanner-character-input-guide
Using Java Scanner for Character Input: A Comprehensive Guide - CodingTechRoom
System.out.print("Enter a character: "); String input = scanner.next(); char character = input.charAt(0); System.out.println("You entered: " + character); Always close the Scanner object to prevent resource leaks.
🌐
YouTube
youtube.com › watch
Scanner Class - Character Input - YouTube
This video goes through how to take a character input
Published: September 20, 2012
🌐
Baeldung
baeldung.com › home › java › java io › read input character-by-character in java
Read Input Character-by-Character in Java | Baeldung
January 15, 2024 - @Test public void givenInputFromConsole_whenUsingScanner_thenReadCharByChar() { ByteArrayInputStream inputStream = new ByteArrayInputStream("TestInput".getBytes()); System.setIn(inputStream); try (Scanner scanner = new Scanner(System.in)) { if (scanner.hasNext()) { char[] result = scanner.next().toCharArray(); assertArrayEquals("TestInput".toCharArray(), result); } } } We simulate the console input in the above test method by instantiating a ByteArrayInputStream with the “TestInput” content. Then, we utilize the hasNext() method to verify if there is another token. Afterward, we utilize th
🌐
Delft Stack
delftstack.com › "delft stack" › "howto" › "java howtos" › "how to get a char from the input in java"
How to Get a Char From the Input in Java | Delft Stack
March 11, 2025 - One of the most common ways to get user input in Java is through the Scanner class. This class is part of the java.util package and provides methods to read various types of input, including characters.