开发者

Is it possible to automatically import other packages in the caller's namespace?

If a user imports:

com.my.package

Is it possible for me to do something in my package, so that anot开发者_StackOverflow社区her package gets imported as well? For example, I'd like to have java.io be automatically imported.


No, it is not possible. However, you can create a package object and put type definitions in it, so that you'll get aliases for classes you think are relevant.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜