From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,604e0f87aa06eab6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-19 03:05:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!peernews3.colt.net!news0.de.colt.net!news-fra1.dfn.de!news-koe1.dfn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Imitation is the sincerest form of flattery Date: Wed, 19 Mar 2003 11:05:44 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <1047665830.579605@master.nyc.kbcfp.com> <1048003120.472344@master.nyc.kbcfp.com> NNTP-Posting-Host: d2-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1048071944 5964 134.91.1.15 (19 Mar 2003 11:05:44 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Wed, 19 Mar 2003 11:05:44 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/831)) Xref: archiver1.google.com comp.lang.ada:35503 Date: 2003-03-19T11:05:44+00:00 List-Id: Hyman Rosen wrote: : Georg Bauhaus wrote: :> class LI extends LinkedList {} :> class LB extends LinkedList {} : : This just demonstrates that Java generics are : second-class citizens. They're just a hidden : version of the casting that needs to be done : now. Depends. If you wanted a list iterator for LI, the information about what is in an LI isn't readily available, as it is in List. So, indeed, how does one know that there should be a Iterator type? OTOH, you won't need casting if you know the hidden type in LI ... (I have to use them, absent a decent alternative ;-) A related question (for me) is, how does one implement nth with List as opposed to List when there is just a generic List? So, in Java you can have both generic and non-generic List interfaces, transparently. And implement chaos :-)