A
Aleksi Kallio
This is something many people seem to have problems with, but didn't
find any solutions that actually work. Generics are quite complicated on
these issues...
I'm trying to make my own float list that implements List<Float>
(java.util.List, using generics).
I'm getting a warning:
Type safety: The return type Float of the method get(int) of type
FloatArrayList needs unchecked conversion to conform to the return type
E of inherited method
Relevant code is:
public class FloatArrayList implements List<Float> {
// ...
public Float get(int index) {
return new Float(data[index]);
}
// ...
}
It's just a warning, so everything works perfectly. But anyway I would
like to keep my Eclipse problems-window clean.
find any solutions that actually work. Generics are quite complicated on
these issues...
I'm trying to make my own float list that implements List<Float>
(java.util.List, using generics).
I'm getting a warning:
Type safety: The return type Float of the method get(int) of type
FloatArrayList needs unchecked conversion to conform to the return type
E of inherited method
Relevant code is:
public class FloatArrayList implements List<Float> {
// ...
public Float get(int index) {
return new Float(data[index]);
}
// ...
}
It's just a warning, so everything works perfectly. But anyway I would
like to keep my Eclipse problems-window clean.