title: Type A is already defined error
body: <p>I tried to search for the solution, but what I found I don't know how to apply in this situation. Please help me correct my code.</p>
  
  <pre><code>package Exercise;
  
  public class Ex11_11 {
  public static void main(String[] args) {
      A a = new A(3);
      }
  }
  
  class A extends B { // type A is already defined, A has a red underline
      public A (int t) {
      System.out.println("A's constructor is invoked");
      }
  }
  
  class B { // type B is already defined, B has a red underline
      public B () {
          System.out.println("B's constructor is invoked");
      }  
  }
  </code></pre>