Possible Duplicate:
Is a Java package the equivalent of a .Net assembly?
I was comparing the access modifiers in Java and C#.
In java the default access allows access to the class being modified to everything in the package that the class is in. In C# the internal access modifier allows access to the class being modified to everything in the assembly that the class is in.
Are Java packages the same as C# assemblies, if not what is the difference.
No they are not same. As also mentioned in the Thread. The best comparison would be with a Java ARchive (Jar) file. Java uses packages to control the namespace, and is very similar to C#'s Namespaces.
Its better to think of a C# assembly as a sealed jar or an OSGI package. A Java package
is closer to a C# namespace
, although none of these concepts map across the two languages perfectly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With