Difference between Namespaces and Packages.
Is there any difference between namespaces and packages or it's just two similar terms used at different platforms?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Jan 9, 2014, 10:26 AM EST
1. You can restrict the access of classes (or class members) to classes within the same package.
2. When importing a package, you can import a single class rather than all classes in the package.
You can't do either of these things with namespaces in C++ or C# though C# does have a 'namespace alias' feature which allows you to import a single class from a namespace as long as you give it an alias. For example:
using VBI = Microsoft.VisualBasic.Interaction;
VB.NET supports #2 but not #1.