Can we create a private class in Java?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Studied at the University of Oxford, Lives in Oxford, UK.
private classes are allowed but only as inner or nested classes.If you have a private inner or nested class, then access is restricted to the scope of that outer class. ... We can not declare outer class as private. More precisely we can not use private access specifier with outer class.
2023-05-13 14:09:55
评论(499)
Helpful(122)
Helpful
Helpful(2)

Ethan Clark
QuesHub.com delivers expert answers and knowledge to you.
private classes are allowed but only as inner or nested classes.If you have a private inner or nested class, then access is restricted to the scope of that outer class. ... We can not declare outer class as private. More precisely we can not use private access specifier with outer class.