Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Iterator<Long> :The type HTMLDocument.Iterator is not generic; it cannot be parameterized with arguments <Long>

Now I'm working on Socket Server, and made multi-thread for muliti-clients for a socket. and Also put each thread of the connection into a HashMap to store the Objects of threads.

Here's the problem: I can't get returned keyset of the HashMap into Iterator. I initialized the key value as . What's the problem? I have no Idea.

HashMap<Long, ClientThread> m_clients;

long m_currentKey;

m_clients.put((Long)m_currentKey, clientThread);

Iterator<Long> itr = m_clients.keySet().iterator(); //error:: Why?

enter image description here

like image 907
Kyeongsik Jason Kim Avatar asked Aug 24 '26 08:08

Kyeongsik Jason Kim


1 Answers

The answer is in the question. You're using the type HTMLDocument.Iterator, instead of using java.util.Iterator.

Fix your imports.

like image 165
JB Nizet Avatar answered Aug 25 '26 23:08

JB Nizet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!