java - Generic interface implementation not working -
my interface is:
public interface salesforcerecordservice<t extends salesforcerecord> { t update(t record) throws ioexception; }
my implimentation class is:
public class salesforcerecordserviceimpl<t extends salesforcerecordimpl> implements salesforcerecordservice { @override public t update(t record) throws ioexception { return null; } }
@override
gives error, method not override method superclass.
i can't able understand problem.
you have pass type super class because expects one. if want salesforcerecordserviceimpl
generic posted, pass t
salesforcerecordservice
.
try this:
public class salesforcerecordserviceimpl<t extends salesforcerecordimpl> implements salesforcerecordservice<t> { @override public t update(t record) throws ioexception { return null; } }
also judging name salesforcerecordimpl
looks me concrete implementation, maybe want this:
public class salesforcerecordserviceimpl implements salesforcerecordservice<salesforcerecordimpl> { @override public salesforcerecordimpl update(salesforcerecordimpl record) throws ioexception { return null; } }
Comments
Post a Comment