0

I have created an interface

public interface serviceApi <T extends BaseData>{
 public void  process(T t);
}

class BaseData{...}
class ChildData1 extends BaseData{...}

Now when I am implementing a service, I'm getting error

class serviceImplOne implements ServiceApi{
   @Override
   public void  process(ChildData1  childData1 ){...} 
}

ChildData1 is something which is extending, BaseData.. But seems what I did was wrong.. How to achieve this

ThrowableException
  • 1,168
  • 1
  • 8
  • 29
  • What is the error you are getting? That would help resolve your issue – pczeus May 02 '20 at 16:49
  • From the initial post of what you provided - it doesn't look right. You have an interface (serviceApi) extending the BaseData class. BaseData should be an interface and serviceAPI extending another inteface? – pczeus May 02 '20 at 16:50
  • 4
    You need to provide the type argument for `ServiceApi`: `class ServiceImplOne extends `ServiceApi`. – MC Emperor May 02 '20 at 16:50
  • @MCEmperor , How can I miss that, I'm sorry,,, but thanks worked.. I've voted your comment – ThrowableException May 02 '20 at 16:53

0 Answers0