How can I limit 2 generic types in a class definition? How should I “where T : ” 2 times?
I have 2 interfaces Simplex and Complex, and I want a class like
public class MyClass<T,S> where T: Simplex, where S: Complex
{
...
}
? or am I doing it wrong? Where can I find this documentation? googling for “java keyword where generics” doesnt really help: where is a very common word… I cant find it in the java trail on generics either…
I believe this is the syntax you’re looking for:
See this Java Tutorials page for more information.