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
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › Java-Scanner-char-input-example
Java Scanner char input example without nextChar
How to add Java Scanner char support The Java Scanner class provides methods that take String input and convert that String into any Java primitive type you might need, except for one: the char. ...
Published: September 10, 2025
Discussions

How to input char in java using scanner?
This is again because it takes only one word as an input string. Note that the input can also be one letter because it'll still be treated as a string. Moving on to charAt() method. This method returns a character of a string at a specified index. Like most programming languages, java also starts ... More on sololearn.com
🌐 sololearn.com
3
2
How to take char input in java
I don't believe you can literally take a char input but you can take the char of a line input at position 0 Just going from memory but I believe the command you want is char myChar = myScanner.next().charAt(0) E: ps don't forget chars are primitive types so compare with == not .equals() More on reddit.com
🌐 r/learnjava
1
1
October 29, 2017
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
Char and scanner error
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. 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
3
1
October 7, 2023
🌐
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 - The best and most simple alternative ... The charAt(0) command is used in combination with the simple next() command which instructs Java to record the next character or string that is input into the command line...
🌐
Edureka Community
edureka.co › home › community › categories › java › how to take character input in java
How to take character input in Java | Edureka Community
October 18, 2023 - 257707/how-to-take-character-input-in-java · Home · Community · Categories · Java · How to take character input in Java · how do I turn a double in an array from 1000 to infinity Jul 9, 2024 · 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 ·
🌐
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 ...
🌐
Baeldung
baeldung.com › home › java › java io › java scanner taking a character input
Java Scanner Taking a Character Input | Baeldung
January 8, 2024 - In this tutorial, we’ll see how to take character input from the Scanner class. Java Scanner doesn’t provide any method for taking character input similar to nextInt(), nextLine(), etc.
Find elsewhere
🌐
Java Vogue
javavogue.com › home › how to get char input in java
How to Get Char Input in Java - Java Vogue
September 23, 2022 - We will see java program for how to take character input in java using Scanner.next().charAt(0) ,System.in.read() and InputStreamReader .
🌐
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 - This class is part of the java.util package and provides methods to read various types of input, including characters. To read a character, you can read a string and then extract the first character.
🌐
Just Academy
justacademy.co › blog-detail › how-to-take-char-input-in-java
How to Take char Input in Java by Roshan Chaturvedi | JustAcademy
In Java, you can take character input using the Scanner class from the java.util package. This is useful when you need to read individual characters from the user, such as when you are collecting single-letter responses or password characters.
🌐
PrepBytes
prepbytes.com › home › java › taking character input in java
Taking character input in Java
August 3, 2023 - Then, we extract the first character from the string using the charAt(0) method and store it in the input variable. 2. Using BufferedReader: The BufferedReader class provides efficient reading of characters from an input stream.
🌐
Dodeascholar
dodeascholar.com › char-input-in-java
Demystifying Char Input in Java: A Beginner’s Guide – DodeaScholar – programming school
Keep in mind that char in Java ... type casting, e.g., (int) myChar. ... When accepting char input from users, implement validation checks to ensure that only a single character is entered....
🌐
Quora
quora.com › How-do-I-take-a-character-input-in-Java
How to take a character input in Java - Quora
Answer (1 of 13): Hello, There are various methods to get input from user in java. However one of the methods i generally use is using Scanner class. Following is the code.. Scanner sc = new Scanner(System.in); String data = sc.next(); /** This will return you a String, then proceed ahead wit...
🌐
Talkerscode
talkerscode.com › howto › how-to-input-char-in-java.php
How To Input Char In Java - TalkersCode.com
The charAt command allows you to filter out undesirable types of data and only allow char data types as input. Any data type can be converted to a char type since charAt only produces output in the shape of a char value.
🌐
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
🌐
YouTube
youtube.com › watch
Input character from user in Java | input char datatype - YouTube
How to input char datatype from user in java is shown
Published: September 2, 2022
🌐
Just Academy
justacademy.co › blog-detail › how-to-get-character-input-in-java
How to Get Character Input in Java by Roshan Chaturvedi | JustAcademy
In Java, character input can be obtained from the user using the Scanner class or the BufferedReader class. This method is commonly used when you need to allow the user to input single characters, such as choosing options from a menu or entering ...
🌐
LabEx
labex.io › tutorials › java-how-to-handle-user-input-for-character-objects-in-java-programming-415248
How to handle user input for Character objects in Java programming | LabEx
In this section, we'll explore the various methods and techniques to accept and validate user input for Character objects. One common way to accept user input for Character objects is by reading from the console using the Scanner class.
🌐
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 - Explore diverse methods in Java for reading characters, covering interactive console input using BufferedReader, file-based character reading with FileReader, and tokenized input handling via Scanner.