Inner Class - Hello World..

A very simple Inner Class example, focused on Inner Class being able to access Outer Class' private member.. (Relax, it is fine..)

App.java
public class App {
 
    private final int appsPrivateMember = 42;
 
    public static void main(final String[] args) {
        final App app = new App();
        final AppInner appInner = app.new AppInner();
        appInner.printPrivateMember();
    }
 
    private class AppInner {
        void printPrivateMember() {
            System.out.println(appsPrivateMember);
        }
    }
}

In Action
MacBook-Pro:Desktop koraytugay$ javac App.java
MacBook-Pro:Desktop koraytugay$ java App
42