Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between "package" and "module"?

I use Java where we only have packages. I know there are other programming languages that also include modules.

What's the difference?

like image 926
OscarRyz Avatar asked Sep 09 '10 21:09

OscarRyz


People also ask

Is package and module same in Python?

A Python package is nothing but a collection of modules along with a __init__.py file. The modules can also be arranged in hierarchy of folders inside a package. Just by adding an empty __init__.py file to the in the folder, Python knows it is a Package.

What is difference between package and module in Java?

A module is a collection of related Java packages and associated resources with a descriptor file, which contains information about which packages/resources are exposed by this module, which packages are used by current module and some other information.


1 Answers

It's hard to compare semantics in the void. (What other languages do you mean?) A "module" might be analogous to a Java class, or a Java package, or something else entirely, depending on that other language. Typically since "modules" tend to be from procedural languages, I'd lean toward saying Java class, but I think the line is very fuzzy at that point and you could argue package quite convincingly.

like image 109
T.J. Crowder Avatar answered Sep 19 '22 04:09

T.J. Crowder