Results 1 to 2 of 2
Thread: nosuchelementexception
- 02-24-2011, 05:07 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 1
- Rep Power
- 0
nosuchelementexception
public static void find(Scanner input, String phrase) {
while (input.hasNextLine()) {
String name = input.next();
if (name.toLowerCase().equals(phrase)) {
System.out.println(name);
}
}
}
i have this code and it does what it is supposed to and finds a name w/in a file, but then after it's found it it gives me the "NoSuchElementException".. how do i get rid of this? :confused:
- 02-24-2011, 05:14 AM #2
Similar Threads
-
Newbie JCreator NoSuchElementException Help!
By Sly Cooper in forum JCreatorReplies: 2Last Post: 12-18-2012, 05:44 PM -
Java Error: NoSuchElementException
By xpngamer in forum New To JavaReplies: 6Last Post: 03-19-2009, 07:37 PM -
[SOLVED] why am i getting this exception" java.util.NoSuchElementException
By ariz in forum New To JavaReplies: 5Last Post: 02-27-2009, 05:19 AM -
Exception in thread "main" java.util.NoSuchElementException
By ragav in forum New To JavaReplies: 4Last Post: 06-08-2008, 02:19 PM -
[SOLVED] Exception in thread "main" java.util.NoSuchElementException
By thevoice in forum New To JavaReplies: 5Last Post: 05-14-2008, 01:43 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks