I want to make a class in java that is accessible to all other classes in my project.
I created this in the default package and now it cannot be seen. What is the best way to do this in java?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Typically the default package is not used, your package would be something like
com.yourdomain.mypackage. As long as you declare the class aspublic, it can be seen by all classes as long as they import it.The class would look like
Then the user of the class would be