C # differences between namespaces and java packages
C # differences between namespaces and java packages
This article mainly introduces the differences between the C # namespace and the java package. It gives a detailed analysis of the similarities and differences between the C # namespace and the java package, which is of great practical value, for more information, see
This article analyzes the differences between the C # namespace and the java package. Share it with you for your reference. The specific analysis is as follows:
Similarities:
1. They are all for reusability-a very important goal in software engineering.
2. Both the namespace in C # And the packages in java belong to the access permission control mechanism.
Differences:
1. the C # namespace is a logical structure that allows the physical storage location of the class files in the organization to be different from the logical structure, the physical structure of class files in Java must be consistent with the logical structure.
2. the Java package itself does not have the sub-package concept. All packages are in parallel, and no one includes them. For example, there is absolutely no relationship between packages and sub-packages between org. dominoo. action. asl and org. dominoo. action. asl. They are independent packages and each has its own class/interface set. In a java file of org. dominoo. action. asl, If You Want To reference a class/interface in org. dominoo. action, you must import org. dominoo. action.
C ++/C # does not use the namespace solution. A namespace can have its own sub-namespace, the package of C ++/C # may have a relationship with the sub-package.
3. Use the import Statement in Java and the using namespace statement in C.
I hope this article will help you with C # programming.