
21 Jun
2007
21 Jun
'07
7:54 p.m.
public class Pair { public A fst; public B snd; public Pair(A fst, B snd) { this.fst = fst; this.snd = snd; } }
OK, I don't even understand that syntax. Have they changed the Java language spec or something?
Yes. As of version 5 (or 1.5, or whatever you want to call it), Java has parametric polymorphism. Do a Google search for "Java generics". -Brent