Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 16th, 2005, 9:45 PM   #1
kalinga1234
Programmer
 
Join Date: Oct 2004
Posts: 31
Rep Power: 0 kalinga1234 is on a distinguished road
help!!!urgent

i want to know the statement for reading a character in java

when i use (char)System.in.read() method java does not recognize it.is there a another way..
kalinga1234 is offline   Reply With Quote
Old Feb 17th, 2005, 12:47 AM   #2
Cup O' Java
Newbie
 
Cup O' Java's Avatar
 
Join Date: Dec 2004
Posts: 18
Rep Power: 0 Cup O' Java is on a distinguished road
cant you use readLine(); ??

for example you do this
static BufferedReader keyboard = BufferedReader(new InputStreamReader(System.in));
String name;
name = keyboard.readLine();

is that what your looking for? remember keyboard could be anything you specify it to be and so can name. dont have to use those names

or do this:
string letterGrade = "F";
System.out.println(letterGrade.charAt(grade));

hope this helps

Last edited by Cup O' Java; Feb 17th, 2005 at 12:56 AM.
Cup O' Java is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:16 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC