gpt4 book ai didi

java - 模块描述 rune 件允许导入语句为什么?

转载 作者:行者123 更新时间:2023-12-02 09:48:46 25 4
gpt4 key购买 nike

请有人解释一下为什么允许导入模块描述 rune 件?
模块描述 rune 件中的import语句有什么用。

import java.util.*;

module superman {
}

最佳答案

如果您使用 provides 指令,一种用途是:

module superman {
provides com.github.me.superhero.Superhero with com.github.me.superhero.Batman;
provides com.github.me.superhero.Superhero with com.github.me.superhero.IronMan;
}

使用导入看起来像:

import com.github.me.superhero.*;

module superman {
provides Superhero with Batman;
provides Superhero with IronMan;
}

关于java - 模块描述 rune 件允许导入语句为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60267177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com