...
> 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.
> 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