Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type Set is not generic; it cannot be parameterized with arguments <Integer>

Tags:

java

eclipse

I am facing this weird problem with my Eclipse. Getting this error

The type Set is not generic; it cannot be parameterized with arguments <Integer>

I cleaned and build my project again. Checked my Configure Build path and ensured that JRESystemLibrary is above MavenDependencies in Order and Export.

Googled as well but I can't find any issue with my code. Why is the error popping up.

enter image description here

like image 929
R11G Avatar asked Nov 28 '22 07:11

R11G


2 Answers

When you call Set it is being taken as your class Set, not java.util.Set.

Change the declaration to java.util.Set and it should be resolved.

like image 195
Thihara Avatar answered Dec 04 '22 21:12

Thihara


Your main method thinks Set is the class that it's contained in.

You want java.util.Set

My suggestion would be to rename your class :p

like image 37
yamafontes Avatar answered Dec 04 '22 21:12

yamafontes