Iterators and Hashtable in Java Baeldung
How can I make the Iterator
point where I want to Hashtable
, other than the start?
Suppose I have
Hashtable P = new Hashtable();
P.put("P10", new Integer (10) );
P.put("P11", new Integer (11) );
P.put("P13", new Integer (13) );
P.put("P17", new Integer (17) );
P.put("P15", new Integer (15) );
Set PSet = P.entrySet();
Iterator ptP = Pset.iterator();
How can I make a Iterator
point P17
without the need for repetition. I would like to write something like C ++, i.e. Something like ptP = P17
to have a pointer or Iterator
point to that element first.
+3
source to share