I have the following classes:
public interface ServiceSynchronizableEntity {
....
}
public class BaseListResponse<T> {
....
}
public class BaseSynchronizableListResponse<T extends ServiceSynchronizableEntity> extends BaseListResponse<T> {
....
}
public class MySecondClass implements ServiceSynchronizableEntity {
....
}
public class MyFirstClass extends BaseSynchronizableListResponse<MySecondClass> {
....
}
public class What<S extends BaseSynchronizableListResponse<ServiceSynchronizableEntity>> {
}
Then I use it as:
What what = new What<MyFirstClass>();
When I want to use MyFirstClass as a type parameter which extend BaseListResponse<ServiceSynchronizableEntity>> it shows me
Main.java:26: error: type argument MyFirstClass is not within bounds of type-variable S
What what = new What<MyFirstClass>();
^
where S is a type-variable: S extends BaseSynchronizableListResponse<ServiceSynchronizableEntity> declared in class What
What is wrong?
Edit: One class was missing. Look at: http://ideone.com/D4snKP
Thanks!