Java泛型,使用子类而不是父类

Java泛型,使用子类而不是父类,java,generics,Java,Generics,我有接口 interface IAdaptor<T, K> { // ... } 接口IAdaptor { // ... } 我已经意识到 class AdaptorImpl imlements IAdaptor<SomeClass1, SomeClass1> { // ... } 类适配器IMPL IMENTS IAdaptor { // ... } 我可以用children代替SomeClass1? 类似于

我有接口

interface IAdaptor<T, K>  
{ 
   // ...   
}  
接口IAdaptor
{ 
// ...   
}  
我已经意识到

class AdaptorImpl imlements IAdaptor<SomeClass1, SomeClass1>  
{  
// ...
}  
类适配器IMPL IMENTS IAdaptor
{  
// ...
}  
我可以用children代替
SomeClass1


类似于
类适配器impl imments IAdaptor

我想,您的意思是

class AdaptorImpl implements IAdapter<SomeClass1, SomeClass1>  
{  
    // ...
}  
类AdapterImpl实现IAdapter
{  
// ...
}  
我不知道你说的“孩子”是什么意思。当然,您可以这样做:

class AdaptorImpl<T extends SomeClass1> implements IAdapter<T, SomeClass1>  
{  
    // ...
} 
类AdapterImpl实现IAdapter
{  
// ...
} 

您尝试了什么,发现了什么?学会热爱调试:)我不知道这个问题在问什么接口和类之间的关系是什么?接口只能实现,所以你的实现与接口无关?或者这只是一个大问题