Path: csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.java.programmer Subject: Re: Java vs C++ Followup-To: comp.lang.java.programmer Date: Mon, 07 Feb 2011 12:26:36 +1300 Organization: Geek Central Lines: 35 Message-ID: References: <4d4d585c$0$81476$e4fe514c@news.xs4all.nl> <4d4d60dc$0$23763$14726298@news.sunsite.dk> <4d4d8322$0$41117$e4fe514c@news.xs4all.nl> NNTP-Posting-Host: 118-92-86-70.dsl.dyn.ihug.co.nz Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: lust.ihug.co.nz 1297034797 3033 118.92.86.70 (6 Feb 2011 23:26:37 GMT) X-Complaints-To: abuse@ihug.co.nz NNTP-Posting-Date: Sun, 6 Feb 2011 23:26:37 +0000 (UTC) User-Agent: KNode/4.4.7 Xref: csiph.com comp.lang.java.programmer:25958 In message , Joshua Cranmer wrote: > On 02/05/2011 11:13 PM, Lawrence D'Oliveiro wrote: > >> They are different things in Java as well. > > The hell they aren't. In Java, there is only one instance of > LinkedList::add(T object). In C++, there are as many instances of > std::list::front as times you use it. > > Try, for example, implementing both List and List in > the same class. Java will tell you that you cannot do it. C++, on the > other hand, wouldn't bat an eye. > >> The only time they become the same thing is in “erasures” and “raw >> types”, which are backward-compatibility mechanisms introduced to avoid >> breaking existing code that doesn’t know about generics. > > I think Java would likely have gone with much the same syntax even if > generics had been introduced in the beginning. > >> And then, of course, the language goes on to use exactly that deprecated >> syntax as the recommended way of accessing static members. > > It's not the same syntax. List is the type of a specific > instance, while the class still remains List. List is a class, not an instance. In something like List L; it is L that is the instance. See, how can you try to tell me what the difference is between Java and C++, when you don’t understand it yourself?