title: Nesting interfaces in AIDL
body: <p>This is not duplicate of <a href="https://stackoverflow.com/questions/2332158/can-we-define-an-interface-within-an-interface">interface within an interface</a>.
  My question is specifically about <a href="https://developer.android.com/guide/components/aidl" rel="nofollow noreferrer">AIDL</a> because the following doesn't seem to work in an AIDL file:</p>
  
  <pre><code>interface Foo {
      interface Bar {
          void doBar();
      }
      void doFoo();
  }
  </code></pre>
  
  <p>The error I get is related to the <code>Bar</code> interface:</p>
  
  <blockquote>
    <p>'interface' unexpected</p>
  </blockquote>
  
  <p>If it is removed, then everything is fine.
  <strong>Anyway, above is valid java code, so why it doesn't work in AIDL?</strong></p>