title: Why can't we have static method in a (non-static) inner class (pre-Java 16)?
body: <p>Why can't we have static method in a non-static inner class?</p>
  <pre><code>public class Foo {
      class Bar {
          static void method() {} // Compiler error
      }
  }
  </code></pre>
  <p>If I make the inner class static it works. Why?</p>
  <pre><code>public class Foo {
      static class Bar { // now static
          static void method() {}
      }
  }
  </code></pre>
  <p>In Java 16+, both of these are valid.</p>