Bill Suttle wrote:I think your answer may be brilliantly correct...however, you never use the new Scanner object in the revised code that you give.
Bill Suttle wrote:Hi Rohan,
the output still produces:
Name of artist:
Name of album:
at the same time...and these should be separate so user can enter data for each individually. It's what I'm getting on my compile...but I use Eclipse.
Bill Suttle wrote:Hi Rohan, I noticed that you only use the new scan "scan1" in the choice of the IF. Can you tell me anything about your rational or the logic of your choice. It works...but I'm just not really clear on why.
Bill
Bill Suttle wrote:Hi Jeff,
When you say that you do not use Scanner, what do you mean? How do you get keyboard input from user and assign it to a variable?
Bill Suttle wrote:Hi Jeff,
Unfortunately, that does not work. Here is my code per your suggestion:
Jeff Verdegan wrote:I don't see any reason for two Scanners. In fact, I'm not sure it can be guaranteed to work. Just like you shouldn't have two separate InputStreams reading from the same source, I don't think you can guarantee you won't get corrupt data with two Scanners.
I'd recommend getting rid of the second Scanner. It will simplify things.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |