What are Java packages, .NET assemblies, and .NET namespaces and is the Java package the same as the .NET Namespace?

So my question is: What are Java, .NET Assemblies, and .NET Namespaces packages and is the Java package the same as the .NET Namespace?

I used Google to get the following:

Java package: Java packages provide a way to organize files into different directories according to their functionality, usability, and also the category to which they belong. An example package is the JDK package.

.NET Assembly: The .NET assembly provides the fundamental unit for grouping physical codes.

.NET Namespace: The .NET namespace provides the basic unit for grouping logical codes.

I read about them, but didn’t really understand if anyone could explain this further?

+7
source share
1 answer

The difference between the assembly and the namespace, as you have already indicated, is that the former organizes the code physically, and the latter logically. Assemblies are your DLL and EXE files. Namespaces are just a point designation that helps you find your classes when writing code.

The Java package is very similar to the .NET namespace. In Java, each open non-nested class must have its own * .java file, and packages must have corresponding directories, so you will read the links to directories when reading on java packages, but not in. NET, because a single file can contain multiple .NET namespaces, and a single namespace can be scattered across multiple directories.

+13
source

All Articles