Can you please explain to me why am I getting this error when trying to define?
a generic class:
public class GenericClass<T, S extends T> {
...
}
Main.java
:
public class Main(){
public static void main(String[] args){
// This line generates compilation error
GenericClass<Number, Integer> object = new GenericClass();
}
}
I am getting this error:
Bound mismatch: The type Integer is not a valid substitute for the bounded parameter <S extends T> of the type GenericClass<T,S>
[SOLVED]
I had another class in my project called Integer :)
Thank you very much for quick response