how do you accept a character value using scanner class? give example.
Answers
Answered by
1
Answer:
We need to use the next() method to read a single character as a string and then use charAt(0) to get the first character of that string. Scanner scanner = newScanner(System.in); char ch = scanner. next(). charAt(0);
Explanation:
hope it something helps you yaar
Similar questions