Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a Java package the equivalent of a .Net assembly?

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.

like image 733
JimDaniel Avatar asked Sep 02 '10 16:09

JimDaniel


People also ask

Is assembly in C# same as package in Java?

No they are not same.

Is there package in C#?

yes it has namespaces.... when ever you add new project to solution, it has its own namespace just like package in java.

Is package and project same 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.

What is same package in Java?

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.


3 Answers

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
like image 153
Kelly S. French Avatar answered Oct 17 '22 08:10

Kelly S. French


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)

like image 45
froadie Avatar answered Oct 17 '22 08:10

froadie


A Java package is like a namespace in .NET.

The equivalent to an assembly in Java is jar file.

like image 1
Nuno Ramiro Avatar answered Oct 17 '22 09:10

Nuno Ramiro