Difference between namespace in C# and package in Java

前端 未结 6 507
日久生厌
日久生厌 2020-11-28 20:32

What is the difference (in terms of use) between namespaces in C# and packages in Java?

6条回答
  •  一整个雨季
    2020-11-28 21:04

    In C++/C#, namespaces are just used for partitioning names to avoid collisions by accidentally using the same name for a variable in different places.

    In Java, packages are far more than just that - packages are used for modules, the naming aspect is just a part of it.

提交回复
热议问题