When I have seen the most references, and when my IDE code is complete, Both have been specified on the implementation eg.
list & lt; String & gt; String = new arreelist & lt; String & gt; ();
Recently I started leaving the normal type of implementation.
list & lt; String & gt; Wire = new arrivate ();
Considering that the compiler is only investigating against the type of Spiegie generic magic, and that the implementation should not be ignored as its common types are erased and running it Should not be affected from time to time.
Am I inexperienced? Is there any reason to include the normal type of implementation?
Is there any reason to include the usual type of implementation?
This is necessary because it is not necessary:
list & lt;? Number & gt; Expansions = New Arrestist & lt; Integer & gt; ();
One of the ways to avoid this for normal cases is to use static utility methods, and compile types to estimate:
class CollectionUtilities {static & LT; T & gt; ArrayList & LT; T & gt; Array list () {new array list & lt; T & gt; (); }} ... Import static collection. *. & Lt; Integer & gt; Number = array ();
This type is safe, and there is no need for normal type of implementation. (Due to this example, the type of type is not safe in the general type of deficiency, there is nothing to do so that you need to specify the type of variable and the general type on the implementation.)
Comments
Post a Comment