how can i scan a character from scannner class( just like int-nextInt,Boolean-nextBoolean)
yapaarachchi
0
Newbie Poster
Recommended Answers
Jump to PostWell, is there a nextCharacter method? No? Then what about simply using next and then toCharArray on the resulting String?
Jump to PostString aLine = scannner.nextLine(); // read the next line (test with hasNext() first?)
char aChar = aLine.charAt(0); // get the first character
All 5 Replies
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
yapaarachchi
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
TheSomalilander
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.