Reading a single char in Java -


How to enter a character from the keyboard in Java?

You can either scan the entire line:

  Scanner s = new scanner (System.in); String str = s.nextLine ();  

Or you can read a single char , you have come to know what encoding is related to:

  Char c = (four) System.in.read ();  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -