开发者

Eclipse + Java: How do I import classes from the default package?

开发者 https://www.devze.com 2023-01-18 02:42 出处:网络
I have classes in an Ent开发者_如何学运维ities package, but I still want to run import stuff that is in the default package... how do I do that?You don\'t.

I have classes in an Ent开发者_如何学运维ities package, but I still want to run import stuff that is in the default package... how do I do that?


You don't.

Sorry.

Though I'm quoting the other answer, you can check out the ORACLE reference that says that that is intended behaviour.

I recommend moving your stuff to a named package.

If you absolutely cannot re-factor, you can try using reflection to access it. Again, check the answer linked above.

0

精彩评论

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