Why cannot I write "Map<String,String> m = (Map<>)obj"?

Weijun Wang weijun.wang at oracle.com
Wed Jul 25 02:11:11 PDT 2012


Just curious, if obj is of type Object, and I want to cast it to 
Map<String,String>, why cannot I use the diamond operator?

Thanks
Max



More information about the compiler-dev mailing list