How to access classes in src from classes in packages

parsa2820 :

enter image description here
[Project structure]

This is my project structure. How can I use User class in registerMenu class?

Neminda Prabhashwara :

A class in src means a class without a package, that means a class in the default package. You can't import a class in the default package.

Therefore you must either implement that class in a package or use reflection to use that class in other classes that are in packages.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=349485&siteId=1