The order of execution of the modules in a program is constrained by the following rule:
If module M
depends on module N
and N
does not depend on
M
, then N
's body will be executed before M
's body, where:
M
depends on a module N
if M
uses
an interface that N
exports or if M
depends on a module that
depends on N
.
M
uses an interface I
if M
imports
or exports I
or if M
uses an interface that (directly or
indirectly) imports I
.
Except for this constraint, the order of execution is implementation-dependent.