Just to know. Which is the proper way of ordering import statements? Also which has more readability?
like,
- External classes (like
java.util.List
) and then internal package
classes. - Just in alphabetical order
Thanks in advance.
Just to know. Which is the proper way of ordering import statements? Also which has more readability?
like,
java.util.List
) and then internal packageThanks in advance.
I prefer this :
1) First group imports based on external and internal APIs 2)Alphabetically within each group
Im not sure if there is a standard. But some projects such like android use the following rule.
Each group is seperated by an extra line. And each group has their imports in alphabetical order.
AFAIK these are based on our preference.