Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #26212

Re: Java vs C++

Date 2011-02-06 21:26 -0500
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Java vs C++
References (6 earlier) <iil74u$rac$1@lust.ihug.co.nz> <4d4f042b$0$23753$14726298@news.sunsite.dk> <iinaj7$2up$2@lust.ihug.co.nz> <4d4f47bb$0$23760$14726298@news.sunsite.dk> <iinjsv$7j3$11@lust.ihug.co.nz>
Message-ID <4d4f584a$0$23758$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source

Show all headers | View raw


On 06-02-2011 21:03, Lawrence D'Oliveiro wrote:
> In message<4d4f47bb$0$23760$14726298@news.sunsite.dk>, Arne Vajhøj wrote:
>> On 06-02-2011 18:24, Lawrence D'Oliveiro wrote:
>>> In message<4d4f042b$0$23753$14726298@news.sunsite.dk>, Arne Vajhøj wrote:
>>>> On 05-02-2011 23:13, Lawrence D'Oliveiro wrote:
>>>>> In message<iil5ed$10m$1@news.eternal-september.org>, Joshua Cranmer
>>>>> wrote:
>>>>>> On 02/05/2011 10:38 PM, Lawrence D'Oliveiro wrote:
>>>>>>> In message<4d4d8322$0$41117$e4fe514c@news.xs4all.nl>, Silvio wrote:
>>>>>>>
>>>>>>>> ... templates and gener[ic]s are completely different beasts.
>>>>>>>
>>>>>>> “Completely” as in “having nothing in common”? Or is this some usage
>>>>>>> of “completely” that I wasn’t aware of?
>>>>>>>
>>>>>>> Please explain.
>>>>>>
>>>>>> Templates in C++ are basically advanced macros--each invocation of a
>>>>>> template type regenerates the class, so a Foo<int>    and a Foo<double>
>>>>>> are two completely different things.
>>>>>
>>>>> They are different things in Java as well.
>>>>
>>>> No. Same code.
>>>
>>> Same code in C++ too, then.
>>
>> No.
>>
>> C++ will generate two classes with two sets of code.
>>
>> (at least that is what common compilers do - I don't know if
>> the standard actually requires it to)
>
> See, it’s clear you’re hung up on specifics of particular implementations,
> not on how the language feature is defined at all.

The language feature is what allows it.

That behavior would not be allowed in Java.

Arne

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar


Thread

Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:03 +1300
  Re: Java vs C++ Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-06 21:18 -0500
  Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 21:26 -0500

csiph-web