Java generic Interface performance
- by halfwarp
Simple question, but tricky answer I guess.
Does using Generic Interfaces hurts performance?
Example:
public interface Stuff<T> {
void hello(T var);
}
vs
public interface Stuff {
void hello(Integer var); <---- Integer used just as an example
}
My first thought is that it doesn't. Generics are just part of the language and the compiler will optimize it as though there were no generics (at least in this particular case of generic interfaces).
Is this correct?