title: Why an anonymous class can't implement two separated interfaces but can implement inner interfaces?
body: <p>An anonymous class can extend only from one class or interface, so I can't do the next :</p>
  
  <pre><code>interface Enjoyable {
      public void enjoy();
  }
  
  interface Exercisable {
      public void exercise();
  }
  
  public class Test {
      public static void main(String[] args) {
          new Enjoyable implements Exercisable() {
              public void enjoy() {
                  System.out.println(":D");
              }
          }.enjoy();
  
      }
  }
  </code></pre>
  
  <p>It says that :</p>
  
  <blockquote>
    <p>Enjoyable.Exercisable cannot be resolved to a type</p>
  </blockquote>
  
  <p>I'm trying to replicate this behavior and I wrote the next code:</p>
  
  <pre><code>interface Enjoyable {
      interface Exercisable {
          public void exercise();
      }
      public void enjoy();
  }
  
  public class Test {
      public static void main(String[] args) {
          new Enjoyable.Exercisable() {
              public void enjoy() {
                  System.out.println(":D");
              }
  
              public void exercise() {
                  System.out.println("Doing exercise !!!");
  
              }
          }.exercise();
  
          new Enjoyable.Exercisable() {
              public void enjoy() {
                  System.out.println(":D");
              }
  
              public void exercise() {
                  System.out.println("Doing exercise !!!");
  
              }
          }.enjoy();
  
      }
  }
  </code></pre>
  
  <p>And then I get :</p>
  
  <blockquote>
    <p>Doing exercise !!! :D</p>
  </blockquote>
  
  <p>Are there another way to simulate It? 
  And way i hace to implement both metods un the anonymous class ?</p>
  
  <p>Thanks</p>