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
Visit Cannot Instantiate Generic Types with Primitive Types
Replace all type parameters in generic types with their bounds or Object if the type parameters are unbounded. The produced bytecode, therefore, contains only ordinary classes, interfaces, and methods.
The type parameter, V
, actually also K
, which is declared in HashMap
, will be replaced with Object
after erasing, because they are unbounded. While primitive type can not be store as Object
.