java - Why are generics completely disabled when you ignore a parameter type? -


first as a background

Given a square with this declaration:

  Some class of public class & lt; T & gt;  

and a sub class which does not use normal parameters:

  public squares someSubClass extends some classes  

A method declared on some classes as follows:

  safe map & lt; String, Object & gt; GetMap (absolute param) {}  

If the sub-class calls the method this way:

  Maps & lt; String, Object & gt; Val = getMap (absolute);  

The compiler briefly complains that the getMap returns a plain map and has an uncontrolled assignment for a normal map. Why is this the case? Is it a documented expectations with generics, and is there any reason for this?

I do not quite know the logic for this, but in this practice they are specified: / P>

A raw type of superclasses (superfinefirefaces), respectively, of any of its parametral invoices, super-classes (superfinefaces).

Given that it is extremely discouraged to use raw types in the new code, they only wanted to make rules for the difference between the raw and parametric types.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -