Private class 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. Example 1 with non inner class: private class Main { public static void main(String[] args) { System.out.println("Inside … Read more