Huston, we have a problem !

"Zdeněk Troníček" tronicek at fit.cvut.cz
Fri Feb 18 10:08:38 PST 2011


As far as I understood the original question, it was as follows: Why we
need to write

List<Integer> p = new ArrayList<>();

and not only

List<Integer> p = new ArrayList(); ?

Is there any special reason for <>?

Z.
-- 
Zdenek Tronicek
FIT CTU in Prague


Maurizio Cimadamore napsal(a):
> On 18/02/11 17:10, Florian Weimer wrote:
>> * Maurizio Cimadamore:
>>
>>>> But are these concepts actually different?  If they are, there has to
>>>> be case where adding<>   to a raw type results in different results at
>>>> run-time.
>>> Well, because of type-erasure you won't be able to tell the difference
>>> between List<String>  and List<Integer>  either - so are they the same
>>> thing?
>> Clearly, those a different at compile time.  What I'm looking for is a
>> case where both Foo and Foo<>  result in legal expressions at compile
>> time and produce different byte code.
>>
> As I've shown with my example, Foo and Foo<> are different at
> compile-time. Just as List<String> and List<Integer> are (well, in a
> more subtle way). They have different members, different supertypes etc.
> They are just different types.
>
> Maurizio
>
>




More information about the coin-dev mailing list