Results 21 to 28 of 28
Thread: Help with Array please
- 04-24-2011, 03:48 PM #21
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
- 04-24-2011, 03:49 PM #22
Member
- Join Date
- Feb 2011
- Posts
- 71
- Rep Power
- 0
I tried running it with out the 2nd scanner but then I get an exception error :/
- 04-24-2011, 03:52 PM #23
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
You should be able to correct it with a call to kb.nextLine(); after the call to kb.nextInt();
- 04-24-2011, 03:54 PM #24
Member
- Join Date
- Feb 2011
- Posts
- 71
- Rep Power
- 0
hey you're right :P
- 04-24-2011, 03:58 PM #25
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Any time you make a call to any scanner method other than nextLine remember it only grabs the next token and stays on the current line. It does not swallow the end of line and will cause these errors.
- 04-24-2011, 03:59 PM #26
Member
- Join Date
- Feb 2011
- Posts
- 71
- Rep Power
- 0
I'll remember that, thanks again for all the help :)
- 04-24-2011, 04:01 PM #27
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
You are welcome. Please mark your thread solved with the thread tools at the top.
- 04-24-2011, 04:02 PM #28
Member
- Join Date
- Feb 2011
- Posts
- 71
- Rep Power
- 0
Similar Threads
-
convert byte array into char array
By kgkamaraj in forum New To JavaReplies: 4Last Post: 09-13-2011, 11:32 AM -
Variable of an object in an array compared to an element of another array?
By asmodean in forum New To JavaReplies: 23Last Post: 09-07-2010, 08:12 PM -
Trying to make an array list // inserting an element to middle of array
By javanew in forum New To JavaReplies: 2Last Post: 09-06-2010, 01:03 AM -
create a 2d char array from a 1D string array
By jschmall12 in forum New To JavaReplies: 1Last Post: 04-27-2010, 09:01 PM -
How to add an integer to a array element and the store that backinto an array.
By Hannguoi in forum New To JavaReplies: 1Last Post: 03-31-2009, 06:40 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks