Is namespace in C# is something similar to package in Java

Exacly as stated in the subject. I do not understand idea of the namespace. Is that something which should work like package in Java?

Jon Skeet
people
quotationmark

They're similar but not the same. In particular, names are also used for access control in Java (where the default access makes a member available within the same package). That's not the case in .NET - namespaces don't come into accessibility at all in .NET.

Additionally, the way you import types can differ between C# and Java: in Java you can import individual classes, whereas in C# the common using directive imports a whole namespace. On the other hand, C# using directives can also specify aliases, which Java doesn't support.

Both packages and namespaces are ways of grouping related types, so to that extent they're the same... but they differ in the details.

people

See more on this question at Stackoverflow