Package se.arnetheduck.j2c.test.methods

Source Code of se.arnetheduck.j2c.test.methods.CovariantInterface$I

package se.arnetheduck.j2c.test.methods;

import se.arnetheduck.j2c.test.Empty;

public class CovariantInterface {
  public interface I {
    Object m();
  }

  public interface J extends I {
    @Override
    Empty m();
  }

  public static class S implements I {
    @Override
    public Object m() {
      return null;
    }
  }

  public static class T extends S implements J {
    @Override
    public Empty m() {
      return null;
    }
  }

  void m() {
    S s = new S();
    T t = new T();
    I i = s;
    J j = t;

    Object o = s.m();
    Empty e = t.m();
    o = i.m();
    e = j.m();
  }
}
TOP

Related Classes of se.arnetheduck.j2c.test.methods.CovariantInterface$I

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.