It seems that this may not be a straighforward as I thought. Typing "java generics array" into your favoured search engine brings up a lot of links all of which suggest that (at least in
Java 5) there is a problem in creating typesafe arrays using generics (I haven't had time to look at this properly but it appears to be a consequence of the type erasure at runtime). Perhaps some other ranchers could spread some light on the subject?
(Given the issues I can only assume that this isn't really in scope for
SCJP )
[ October 29, 2008: Message edited by: Graeme Jenkinson ]