iterator - Remove Entries From TreeMap, getting java.util.NoSuchElementException -
I am trying to remove some entries from TreeMap using some arguments. This is my code
treemark Obtaining an exception: -
java.util.NoSuchElementException at java.util.TreeMap $ PrivateEntryIterator.nextEntry (TreeMap.java:1113) On Java.util.TreeMap $ EntryIterator.next (TreeMap.java:1151) java.util. Treemap $ EntryIterator.next (TreeMap.java:1146) What is the exception? This error is in the recurrence please correct me also.
You should check the following elements like this:
Treemark & lt; String, Object & gt; Tree map = some entry (); Iterator & lt; Entry & lt; String, Object & gt; & Gt; IARAR = treemap Enterreset () Iterator (); Entry & lt; String, Object & gt; enter; While (iter.hasNext ()) {entry = iter.next (); {(Entry.getKey ()) in (search) {iter.remove (); }} If you call iter.next () , then there is no next element, then NoSuchElementException goes.
Comments
Post a Comment