I\'m a newbie to Java.
I have provided a short snippet from my code for BFS.
public int bfs(Person p, Person q) {
private HashMap
Satyendra Sharma's answer is absolutely correct, but here's some reasoning of what exactly the error message is saying.
The error is caused by using a primitive type, which cannot be used as a generic type argument. For instance, List
is incorrect, whereas List
is correct. Wrapper classes can be used to wrap the primitive values and yield a reference type, which can be used with generics.
The message "Insert dimensions to complete expression/referenceType" is probably because in order for the expression to become valid, the only valid token here is a set of square brackets.
For instance,
HashMap marked;
will just compile fine. This is because, unlike a boolean
, a boolean[] is an object.