Object Oriented Programming with D Language. Private access specifier.
Christopher Wright
dhasenan at gmail.com
Fri Aug 22 16:59:56 PDT 2008
Jacob Carlborg wrote:
> In Java you can have several classes in the same file and they have
> access to each others private members, it's called inner classes. It's
> useful for listeners for example.
Java requires you to use classes for anything that has structure or
anything that can do anything. You can't have two top-level classes in
one file, though; you need another class to act as a namespace for them.
And using inner classes for events is ugly. I implemented an event
broker in Java, but I couldn't stand using it because I had to use inner
classes to get anything done.
More information about the Digitalmars-d
mailing list