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
Generic are resolved during compile time and during runtime their no context about the generic used in your code. The Object is than type cast into the class type provided against the generic type. Now both primitive and object are completely unrelated entities in java. Direct time-cast of Object to primitive type isn't possible in java. For this reason the use of primitive type in generic is disallowed and eclipse gives this warning.