Sealed classes - would you want them in D? (v2)

Uknown sireeshkodali1 at gmail.com
Sat May 19 09:37:56 UTC 2018


On Saturday, 19 May 2018 at 09:10:32 UTC, KingJoffrey wrote:
> On Saturday, 19 May 2018 at 08:32:28 UTC, Uknown wrote:
>>
>> I ported your example to Java. Surprisingly, it compiled and 
>> executed just fine:
>
> All I see, is a class, with static members. How else would it 
> work?
>
> This is the equivalent of my D example, in Java:
>
> ( it won't even compile.  phew!  )
>

The point was encapsulation as you defined it was broken. private 
members were directly modified outside their class. In your 
words, everyone was a friend.


More information about the Digitalmars-d mailing list