How high level is D?

Neia Neutuladh neia at ikeran.org
Thu Nov 22 16:05:28 UTC 2018


On Thu, 22 Nov 2018 08:13:13 +0000, Laurent Tréguier wrote:
> On Thursday, 22 November 2018 at 00:14:40 UTC, NoMoreBugs wrote:
>> (2) - its' completely unlike what a C++/Java/C# programmer would expect
>> (the 3 most widely used languages).
>>
>> If (2) weren't also fact, I would not feel inclined to mention it.
> 
> You can leave Java out of this list though. The following Java code will
> compile and run:

I pointed that out ages ago (multiple times) and the person just ignored 
it.

> It goes unnoticed since Java forces you to have one top-level class per
> module, but Java treats `private` exactly like D: at the module level.
> Within that module, any class can access any member from any other
> class, no matter if ti's marked as `private`.

Java can have multiple top-level classes per source file, but only one can 
be public. You can't access private variables from a different top-level 
class in the same source file.


More information about the Digitalmars-d mailing list