Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

iterating through a hash map

807607Oct 6 2006 — edited Oct 6 2006
Hello, i have a hash map that I would like to iterate through. Here is the code:
HashMap<Integer, Object> hash= new HashMap<Integer, Object>();
Set keys = hash.keySet();
Iterator iter = keys.iterator();
However, I am getting an error with the above code. It says that Set cannot be resolved to a type. How do i iterate through the keys of a hash map?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 3 2006
Added on Oct 6 2006
2 comments
290 views