加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java中的import语句顺序[closed]

发布时间:2020-12-14 16:32:37 所属栏目:Java 来源:网络整理
导读:想知道.导入语句的正确方法是哪一种?还有更多的可读性吗? 喜欢, 外部类(如java.util.List),然后是内部包 类. 按字母顺序排列 提前致谢. 解决方法 从 Java Programming Style Guidelines The import statements must follow the package statement. import
想知道.导入语句的正确方法是哪一种?还有更多的可读性吗?

喜欢,

>外部类(如java.util.List),然后是内部包
类.
>按字母顺序排列

提前致谢.

解决方法

从 Java Programming Style Guidelines

The import statements must follow the package statement. import
statements should be sorted with the most fundamental packages first,
and grouped with associated packages together and one blank line
between groups.

….. …..

The import statement location is enforced by the Java
language. The sorting makes it simple to browse the list when there
are many imports,and it makes it easy to determine the dependiencies
of the present package The grouping reduce complexity by collapsing
related information into a common unit.

参考Java Tutorial链接了解更多信息.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读