Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Jeanne Boyarsky
Tim Cooke
Sheriffs:
Liutauras Vilda
paul wheaton
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Carey Brown
Frits Walraven
Bartenders:
Piet Souris
Himai Minh
Forum:
Beginning Java
write method
mandy fern
Greenhorn
Posts: 12
posted 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
How do I write a method in() to read numbers from the console?
Cindy Glass
"The Hood"
Posts: 8521
posted 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Try something like this:
<font size=2.5> import java.io.*; class Test { public static void main(String [] args) throws IOException { System.out.println("Please, give me an char:"); BufferedReader consoleIn = new BufferedReader(new InputStreamReader(System.in)); String stringChar = consoleIn.readLine(); char fromConsoleInput = stringChar.charAt(0); System.out.println("You gave me char: " + fromConsoleInput + "!"); } }
"JavaRanch, where the deer and the Certified play" - David O'Meara
bacon. tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Methods
Compile Time Error for Final Class
How tough are the IO and AWT questions?
converting Byte[ ] to BLOB output stream
regex utf-8 characters
More...