I found the definition about String:
- Oracle Jdk: http://docs.oracle.com/javase/8/docs/api/java/lang/String.html
- Open Jdk: http://docjar.com/html/api/java/lang/String.java.html
String in Oracle Jdk extends Object but Open Jdk doesn't
And when i create an example code with generic type as:
public void testMethod(Map<String,?> map)
Map<String,String> tmpMap = new HashMap<String, String>();
tmpMap.put("Test", "Test");
testMethod(tmpMap);
it compile and run without any errors on two platforms.
? in Generic is any types which extends from Object
So my question is:
- There are some mistakes when creating Open Jdk document or i am misunderstanding about Generic or String type in Java?
See also:
Objectimplicitly.Objectimplicitly.Stringdoes not extends Object type :-)