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
🌐
PrepBytes
prepbytes.com › home › java › taking character input in java
Taking character input in Java
August 3, 2023 - 2. How to take multiple character inputs in Java? If you need to take multiple characters as input, you can use the nextLine() method of the Scanner class to read a string.
🌐
Upgrad
upgrad.com › home › blog › software development › how to take multiple string input in java using scanner: a step-by-step guide
How to Take Multiple String Input in Java Using Scanner
July 7, 2026 - Each string entered is displayed with "You entered:" followed by the input, demonstrating how to handle multiple string input in Java using Scanner. 3. Validating Inputs: Add validation to ensure inputs meet criteria such as length, format, or forbidden characters.
Discussions

java - Take a char input from the Scanner - Stack Overflow
You should add the code from the ... might be inavailable some time. 2017-06-16T06:20:26.7Z+00:00 ... Save this answer. ... Show activity on this post. There are two approaches, you can either take exactly one character or strictly one character. When you use exactly, the reader will take only the first character, irrespective of how many characters you input. ... import java.util.Scanner; ... More on stackoverflow.com
🌐 stackoverflow.com
arrays - Getting multiple inputs from user with char and integers Java - Stack Overflow
I'm trying to allow the user to put in multiple inputs from the user that contain a char and integers. Something like this as input: A 26 16 34 9 and output each int added to an array. I was think... More on stackoverflow.com
🌐 stackoverflow.com
January 15, 2019
java - Read multiple characters in char input and convert to double - Stack Overflow
If I input more than one character, it only recognises the first character. How do I make the program see multiple characters that a user inputs as a char? More on stackoverflow.com
🌐 stackoverflow.com
How to take character input in java - Stack Overflow
I knew this system to take String as input. It seems to me taking input a character and a String is different things. By the way thank you for your replay. More on stackoverflow.com
🌐 stackoverflow.com
People also ask

What’s the best way to store multiple string inputs in Java for later use?
When handling multiple string inputs, especially if the count isn’t fixed, use dynamic data structures like ArrayList. After reading strings using scanner.nextLine() or splitting a line into tokens, add each entry to the list. This allows you to easily perform operations like searching, filtering, or mapping over the input later in the program.
🌐
upgrad.com
upgrad.com › home › blog › software development › how to take multiple string input in java using scanner: a step-by-step guide
How to Take Multiple String Input in Java Using Scanner
How do you handle exceptions or errors while taking multiple string inputs using Scanner?
Scanner input operations can throw exceptions such as NoSuchElementException or IllegalStateException if input is prematurely closed or unavailable. Although strings rarely cause format issues like numbers do, you should still handle unexpected inputs or stream closure gracefully. Using try-catch blocks around input reading logic ensures your program can inform users of errors and request re-entry instead of crashing. This practice is critical in interactive applications like user registration or command-line tools, where reliability improves user trust and reduces debugging time.
🌐
upgrad.com
upgrad.com › home › blog › software development › how to take multiple string input in java using scanner: a step-by-step guide
How to Take Multiple String Input in Java Using Scanner
How can I optimize Scanner usage when taking multiple string inputs in large-scale applications?
In large-scale or performance-sensitive applications, the scanner may become a bottleneck due to internal parsing and buffering. Alternatives like BufferedReader combined with String.split() offer faster input reading for bulk data. However, Scanner’s convenience for tokenizing inputs remains valuable for simpler interactive programs. To optimize Scanner usage, you can minimize calls to input methods, reuse Scanner objects, and avoid unnecessary parsing steps. Also, consider closing Scanner streams properly to free resources. These practices are critical when building scalable command-line uti
🌐
upgrad.com
upgrad.com › home › blog › software development › how to take multiple string input in java using scanner: a step-by-step guide
How to Take Multiple String Input in Java Using Scanner
🌐
LabEx
labex.io › tutorials › java-how-to-handle-multiple-character-inputs-450817
How to handle multiple character inputs | LabEx
Character input is a fundamental concept in Java programming that allows developers to receive and process individual characters from various input sources. In this section, we'll explore the basic mechanisms for handling character inputs in Java. Java provides multiple ways to handle character inputs:
🌐
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...
🌐
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 - Scanner input = new Scanner (system.in); char a = input.next().charAt(0); When you use next(), you’re telling Java that it's about to accept an input of an unspecified data type.
🌐
Know Program
knowprogram.com › home › program to take multiple string input in java using scanner
Program to Take Multiple String Input in Java using Scanner
September 20, 2021 - Then we created a String array of size 5 to store five-string values. Using loop and nextLine() method this program read 5 string value and stored into the string array. After that, using loop string elements are fetched and displayed to the screen.
Find elsewhere
🌐
LabEx
labex.io › tutorials › java-how-to-handle-multiple-input-characters-in-java-431423
How to handle multiple input characters in Java | LabEx
Learn efficient techniques for handling multiple input characters in Java, exploring input streams, reading methods, and advanced character processing strategies for robust Java applications.
🌐
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
🌐
Just Academy
justacademy.co › blog-detail › how-to-get-character-input-in-java
How to Get Character Input in Java by Roshan Chaturvedi | JustAcademy
6) Loop for multiple characters: If you need to get multiple character inputs from the user, you can use a loop to read each character one by one until the desired number of characters is obtained.
🌐
SourceBae
sourcebae.com › home › how to take multiple string input in java using scanner?
How to Take Multiple String Input in Java Using Scanner? - SourceBae
August 21, 2025 - This class is part of the java.util package, so you should include the following import statement: ... Create a Scanner Object: Next, create an instance of the Scanner class. This object will be used to read input from various sources, such as the keyboard or files. ... Prompt for Input: Display a prompt message to inform the user about the expected input.
🌐
Stack Overflow
stackoverflow.com › questions › 54186167 › getting-multiple-inputs-from-user-with-char-and-integers-java
arrays - Getting multiple inputs from user with char and integers Java - Stack Overflow
January 15, 2019 - A character is not an int. You cannot read an int to expect something like 'A'. You can read a String and take its first character though. Scanner doesn't offer a convenient method to read the next String and expect it to be only one-character long.
🌐
Brainly
brainly.com › computers and technology › high school › how do you take multiple string inputs in java using the scanner class?
[FREE] How do you take multiple string inputs in Java using the Scanner class? - brainly.com
June 13, 2023 - Redad more on Java hgere brainly.com/question/26789430 ... To take multiple string inputs in Java, you need to import the Scanner class, create an instance, prompt for the number of strings, and use a loop to read and store each input.
🌐
Stack Overflow
stackoverflow.com › questions › 41856866 › read-multiple-characters-in-char-input-and-convert-to-double › 41857998
java - Read multiple characters in char input and convert to double - Stack Overflow
The 2026 Annual Developer Survey is live— take the Survey today! Find centralized, trusted content and collaborate around the technologies you use most. Learn more about Collectives ... Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... Save this question. Show activity on this post. public static void main(String[] args) { char ch; ch = JOptionPane.showInputDialog("").charAt(0); if (Character.isLetter(ch)) { System.out.println(Character.toUpperCase(ch)); } if (Character.isDigit(ch)) { Math.sqrt(ch); System.out.println(ch); } if (Character.isWhitespace(ch)) { int code = ch; System.out.println (code); } }
🌐
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 - What is the procedure for obtaining character input in Java, and could you provide a detailed ... character input can be accepted in Java programming?
🌐
Stack Overflow
stackoverflow.com › questions › 28081573 › getting-multiple-characters-when-using-scanner-next-method-in-java
Getting multiple characters when using Scanner next() method in Java? - Stack Overflow
Following is the excerpt from javadocs. The scanner can also use delimiters other than whitespace. This example reads several items in from a string. You can use parentheses as the delimiter in your case.
🌐
Stack Overflow
stackoverflow.com › questions › 46984177 › receive-multiple-char-input-from-a-single-line-in-java
java.util.scanner - receive multiple char input from a single line in java - Stack Overflow
You can do this either with a special character, eg. if(c == '.') break; or you can just press Ctrl+Z. EDIT: Based on the edit to the question and the full code being presented, I think the suggestion of needing the extra loop is now redundant.
🌐
YouTube
youtube.com › watch
How to take Character Input in Java - YouTube
Learn how to take character input in java using scanner class. You can also use bufferedreader and Datainputstream as well to accept. You must learn as how t...
Published: February 27, 2014
🌐
Unstop
unstop.com › home › blog › how to take input in java | scanner class & more (+examples)
How To Take Input In Java | Scanner Class & More (+Examples)
February 27, 2025 - The useDelimiter method allows you to customize how the input is tokenized, which can be particularly useful when dealing with non-standard input formats. This section provides a comprehensive overview of the Scanner class, showcasing its ease of use through detailed code examples, a breakdown of its methods, and a balanced look at its pros and cons. Want to learn all about Java programming? Check out this amazing course and fast-track your journey to becoming a Java developer. BufferedReader is a class in the java.io package that reads text from a character input stream, buffering characters for efficient reading.