Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

Best way to get user input from the console window?

Thread view: 
Sean W - 31 Aug 2006 15:00 GMT
Hey everyone,

I'm a freshman in college and I'm currently learning java for one of my
classes. I know this question is really simple, but I've seen a number
of different ways to do this, and the example my teacher provided
didn't exactly work...

Any Suggestions?

(I'm new to mailing list groups as well. I got sick of all the flaming
and non-useful posts with conventional forums)
Andrew Thompson - 31 Aug 2006 15:25 GMT
...
> I'm a freshman in college and I'm currently learning java for one of my
> classes. I know this question is really simple, but I've seen a number
> of different ways to do this, and the example my teacher provided
> didn't exactly work...

Lazy, was it?  Did you try cash inducements, or
threats of restrictions of liberty?  That often scares
input methods into line..

Or, to put that another way, please be clear, specific
and *precise* with all code and test output.

Otherwise you might get suggestions like..

> Any Suggestions?

Change the ',' to a '.' on line 46.

> (I'm new to mailing list groups as well.

This is known as a 'usenet newsgroup', just in case
there is any confusion.

> ..I got sick of all the flaming
> and non-useful posts with conventional forums)

(chuckle) Define 'flame'?

I've done about three in my lifetime, but have been
accused of hundreds.

But to ge to the meat of your query, I generally
prefer a JOptionPane for quick input from the CLI.
It won't work in 'old java', but that usually does
not matter.

OTOH, I think it would be far more productive (and
instructive) to figure out why the teacher's method
did not 'work', so..  Back to you.

Andrew T.
Oliver Wong - 31 Aug 2006 16:41 GMT
> Hey everyone,
>
[quoted text clipped - 4 lines]
>
> Any Suggestions?

   The reason you've seen a number of different ways to do this is that
there are a number of different ways to do it, and they each have their own
quirks. As Andrew suggested, it's probably best if you do it the way the
teacher wants you to do it, or else you may run into problems in future
assignments when the quirks of the teacher's way won't match up with the
quirks of the way you end up using.

> (I'm new to mailing list groups as well. I got sick of all the flaming
> and non-useful posts with conventional forums)

   comp.lang.java.programmer is a newsgroup, so you might want to read
http://kb.iu.edu/data/abcy.html

   - Oliver


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.