I am a .Net developer starting Java development for Android and would like to know if it's correct to think of Java packages like .Net assemblies.
No they are not same.
yes it has namespaces.... when ever you add new project to solution, it has its own namespace just like package in java.
A project is an IDE-level grouping; its a set of source files, configurations, assets, ect. that make up a working application. A package, on the other hand, is a grouping of related classes/source files.
All Java source and class files of classes belonging to the same package are located in the same directory. Java packages can contain subpackages. Java packages can thus make up what is called a package structure. A Java package structure is like a directory structure.
No.
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.
Here is how I'd compare the environments
Java .Net
==== ====
Class Class
Package Namespace
Jar Assembly
No, I think a Java package would be more similar to a namespace
And an assembly would be more like a jar (I'm not so sure about this, as I'm much more familiar with Java than .Net... correct me if I'm wrong)
A Java package is like a namespace in .NET.
The equivalent to an assembly in Java is jar file.
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