<pre><code>public class Test {
    public static void main(String[] args) {

    }
}

class Outer {
    void aMethod() {
        class MethodLocalInner {
            void bMethod() {
                System.out.println("Inside method-local bMethod");
            }
        }
    }
}
</code></pre>

<p>Can someone tell me how to print the message from <code>bMethod</code>?</p>

You can only instantiate
```
MethodLocalInner
```
within
```
aMethod
```
. So do
```
```
void aMethod() {

    class MethodLocalInner {

            void bMethod() {

                    System.out.println("Inside method-local bMethod");
            }
    }

    MethodLocalInner foo = new MethodLocalInner(); // Default Constructor
    foo.bMethod();

}
```
```