Java Generics - implements and extends

后端 未结 2 1433
挽巷
挽巷 2020-12-20 13:31

I am trying to write something like

public class A implements B {}

and

public abstract class M

        
2条回答
  •  被撕碎了的回忆
    2020-12-20 13:51

    There is no implements keyword in generic bounds. It's only extends

    Furthermore - you should specify the type parameter only in the class definition, and not in supertypes. I.e.

    public class A implements B {}
    

提交回复
热议问题