Difference between namespace in C# and package in Java

前端 未结 6 528
日久生厌
日久生厌 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:26

    In java you can apply various access specifiers to classes which will have impact on your packages.

    protected : accessible to same package and to its subclasses in another package, default : accessible to same package, public : universally accessible, private : not even accessible by the same package.

    These type of access specifiers are not applicable to namespace in c sharp

提交回复
热议问题