What's the difference between requires and requires static in module declaration

前端 未结 2 556
陌清茗
陌清茗 2020-12-03 13:59

What\'s the difference between requires and requires static module statements in module declaration?

For example:

2条回答
  •  渐次进展
    2020-12-03 14:34

    The primary difference between the two is that in case of

    requires static foo.module;
    

    The dependence is mandatory in the static phase, during compilation, but is optional in the dynamic phase, during execution while on the other hand

    requires bar.module;
    

    Is added to declare that the module depends, by name, upon some other modules, at both compile time and run time.

提交回复
热议问题