I'm trying to find the links but I'm sure I was reading about how
ArrayList internally uses an Object[].  Because it needs to construct
the array and it's not passed in.

http://www.docjar.com/html/api/java/util/ArrayList.java.html

When generics first came along I thought 'great, no more casting'.  So
I disassembled some source, only to find that casts still do exist
after the caller calls a generified method.  This is because generics
can still be subverted with casts.

(Now I would hope that the JIT could detect cases where subversion
can't occur and remove the cast, but that's another story).

My assumption was that generics is a 'caller side typecheck facade'.
An ArrayList<String> is just an ArrayList with type checks on input
and output.  Hence my definition of 'bollocks'.

But I have been known to be wrong about some things on rare occasion.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to