Classes from unnamed (default) package is not visible from class in named package
Well, this is a well known fact for around 10 years now, but I got trapped into compilation error involving this “feature” recently. Here is more detailed explanation:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4361575
to make this story short – always remember to put your classes into packages, and never try to use class from unnamed package from within named package class, compiler will not give you meaningful error notice.
This is only valid for compilers from 1.4 and up. If you have some older class files which were in unnamed package then they are no longer usable – unless you have sources. Well – actually there is a method, use reflection API.
Leave a Reply