0
Java Generics
I Try to convert my method in java into a generic method, but it does not work. My problem is, that i have two data types as Parameter. My method is: public static int whichInt(int[] a, char[] b) { ... My solution was something like this: public static <T,S extends Comparable<T,S>> int whichint(T[]a, S[] b){ ... Does somebody know how to write this method correctly? Best regards, stefano
2 Answers
+ 9
0
Hi Stefano,
Try this way:
public static <T extends Comparable<T>,S extends Comparable<S>> int whichint(T[]a, S[] b) {
...
}