Nested static class can directly access only static variables and methods. Nested static class is considered a top-level class. class MainClass { static class NestedStaticClass { } public static void main(String[] argv) { System.out.println(); } }