Templated Interfaces?
Bruno Medeiros
brunodomedeiros+spam at com.gmail
Mon Sep 8 08:54:10 PDT 2008
Jarrett Billingsley wrote:
> "Benji Smith" <dlanguage at benjismith.net> wrote in message
> news:g8sih3$7h4$1 at digitalmars.com...
>> Simen Kjaeraas wrote:
>>> You do not need to initialize the the array with the "new I!(char)[]".
>>> Just use
>>>
>>> I!(char)[] array;
>>> array ~= new C!(char)('a');
>>> ...
>>> char value = array[0].x();
>> Gotcha.
>>
>> Coming from Java, it's hard getting used to which types require a 'new'
>> and which ones don't. I find the array types especially confusing.
>>
>> Thanks for your help!
>>
>> --benji
>
> Well arrays work _almost_ the same way as in Java, the only difference being
> that they can change their size.
>
Also, Java's arrays are Object's, D's arrays are not.
--
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d-learn
mailing list