CodesJava

Easy learning with example program codes

can we declare a class as private in java?


Yes, we can declare a class as private but these classes can be only inner or nested classes. We can’t a top-level class as private because it would be completely useless as nothing would have access to it.

Java interview questions on access modifiers



Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap