Is it possible to have a private class?
Share
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.
Since you start with Java – on the first degrees on your learning curve you will eventually not need any private classes. They make sense for inner classes (a class within a class) when this inner class is not usable/useful outside the parent class.
But for now: just keep in mind, that private is not forbidden in general for classes but don’t use this modifier.
Or – if you use eclipse/netbeans: just create a class, change the modifier from public to private and see what happens.