I\'m new to Java. While coding a Map<>, I found out that declaring Map is a syntax error while Map is OK
1) Yes, Java generics only work on object types. This is because of how they're implemented, which is through type erasure - essentially, once it's compiled down to bytecode all generic types are replaced with Object - this was done so that java generics could work without modifying the underlying JVM/bytecode (bad decision, imo).
2) Yes, there will some boxing / unboxing penalty; can't be avoided, I'm afraid.