In an Android framework I am trying to understand, I find a statement like this:
public Call<GeneralResponseSO> performApiCall(/*...*/) {
// ...
}
But GeneralResponseSO
is defined like this:
public class GeneralResponseSO<T> {
// ...
}
Shouldn't the api method specify which type T
is? I can't seem to grasp why the compiler doesn't give an error, and what type T
then is.
Or does the compiler do magic to filter out all the generics from the class? So that all variables/methods that use T
are removed? I wouldn't expect the Java compiler to perform such magic though.