learn java
The moose likes Beginning Java and the fly likes Error with System.in reading prgm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error with System.in reading prgm" Watch "Error with System.in reading prgm" New topic

Error with System.in reading prgm

George Han

Joined: Aug 17, 2005
Posts: 17

Thats my code, I tried to do some tests, I first typed 3, so I get to the "That was Not a Name, If you wish to Quit press q or Q" part, But To test it will loop after I press d, instead of Q or q, But IT gives "Enter Name as Last, First I. " And I cant type anything All it gives is this _
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 691
To help you see what is happening in your code you need to display the values of the variables. Put some System.out.println() statements in the code that display the contents of all the variables so you can see how they are changed.

Questions regarding your code:
what is the purpose of the variable: counter? Why do you change its value?
What is Yay used for? The name doesn't mean anything. Would a better name be loopControl?
Have you tried LearnNowOnline? http://www.learnnowonline.com/
subject: Error with System.in reading prgm