In this line
public TreeSet<int> storage = new TreeSet<int>();
I get the following error when I try to compile:
error: unexpected type
public TreeSet<int> storage = new TreeSet<int>();
What do I need to do to fix this?
In this line
public TreeSet<int> storage = new TreeSet<int>();
I get the following error when I try to compile:
error: unexpected type
public TreeSet<int> storage = new TreeSet<int>();
What do I need to do to fix this?
Generics enable types (classes and interfaces) to be parameters when defining classes, interfaces and methods. So, parameters SHOULD not be primitive.
Change it to,
TreeSet <Integer> storage = new TreeSet<>();
(or)
Set <Integer> storage = new TreeSet<>();