April 05, 2004 Re: inner classes | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Ivan Senji | I just do this(as im sure a lot of other people do)
---------------------
class outer
{
char[] test = "hi there";
this()
{
new inner("outer");
}
class inner : Frame
{
this(char[] str)
{
outer o;
printf(o.test);
}
}//end inner
}//end outer
You can do exactly the same with methods ie:
outer o;
o.doIt();
Phill.
"Ivan Senji" <ivan.senji@public.srce.hr> wrote in message news:c4p7bv$bi$1@digitaldaemon.com...
> "Phill" <phill@pacific.net.au> wrote in message news:c4ogmn$22un$1@digitaldaemon.com...
> > But then again:
> >
> > Definition: An inner class is a nested class whose instance exists
> within
> > an instance of its enclosing class and has direct access to the instance members of its enclosing instance.
> >
> > So it is clearly not an Inner class that D has.....
>
> I was thinking about how great would it be to have that but i didn't know
it
> is
> called inner class. It would solve a big design problem in one of my
> projects!
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.648 / Virus Database: 415 - Release Date: 3/31/2004
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply