Question - Can you declare a class as private?
Answer -
Yes, we can declare a private class as an inner class. For example,
class MyPrivate {
private static class MyKey {
String key = "12345";
}
public static void main(String[] args) {
System.out.println(new MyKey().key);//prints 12345
}
}