samedi 12 mai 2018

Comparing a Generic value to an integer

    public static <T extends Comparable<T>> boolean isMember(T[] a, T x) {
boolean resultat = false;
int anfang = 0;
int ende = a.length-1;
int ergebnis = a.length/3;

int searchinterval = ergebnis;


if(searchinterval<x) {}

I get the error the operator is undefined for the argument type(s) T

    how can I compare nevertheless?

Aucun commentaire:

Enregistrer un commentaire