DEV Community


Discussion on: Can I import local class files in Java, like you can Python?

baenencalin profile image
Calin Baenen Author

But, can a package be in a directory below the current package?
If not, where would the packages have to be, and how would I enforce this on to the computer of the user that uses my program?

Thread Thread
thefern profile image
Fernando B 🚀

Sorry is been a while since I last program in Java memory is a bit blurry. According to SO you can't have nested packages, but I just tried and I was able to create a package inside a package. So what you're trying to do is doable.