Re: Package == NameSpace?



Miles wrote:
Arne Vajhøj wrote:
Miles wrote:
Are they pretty much the same?

Yes.

Java package = UML package = C++ namespace = C# namespace

Thanks. I was thinking in terms of C#, should have pointed that out.

From 10000 feet it is the same.

There are a few details that differ.

In Java the directory structure should match the package structure. No
such restriction in C#.

In C# you can have multiple namespaces in one file. In Java one file
belongs to one package (see previous).

Java has default/package accessibility. C# internal accessibility goes
in assemblies.

If you use VS and Eclipse and let them structure the project, then
you will not feel the differences much.

Arne
.



Relevant Pages

  • Re: Some understanding questions...
    ... > must be private? ... class that has same namespace or not. ... In Java you should be able to do so ... Since there's the notion of "package private" too as I ...
    (microsoft.public.dotnet.vjsharp)
  • Re: Modules -> do I have is straight?
    ... ruby book and this forum modules are like superclasses. ... In java you create a package (i know you all know this already I am ... The namespace, unlike in Java, is in no way enforced and it ...
    (comp.lang.ruby)
  • Re: Package == NameSpace?
    ... belongs to one package. ... Java has default/package accessibility. ...
    (comp.lang.java.programmer)
  • Re: (OT) In search of a definition
    ... primarily works under Windows XP, I am in search of a "good ... a package was NOT part of the language. ... without looking for something to formulate a hostile response from. ... use in Java is the same as its use in C or other languages. ...
    (comp.lang.cobol)
  • Re: (OT) In search of a definition
    ... a package was NOT part of the language. ... without looking for something to formulate a hostile response from. ... use in Java is the same as its use in C or other languages. ...
    (comp.lang.cobol)