java中的import语句顺序[closed]

前端之家收集整理的这篇文章主要介绍了java中的import语句顺序[closed]前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
想知道.导入语句的正确方法是哪一种?还有更多的可读性吗?

喜欢,

>外部类(如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链接了解更多信息.

猜你在找的Java相关文章