Obténir la plus grande valeur d’un tableau

Author:


{filelink=12321}

if (a.length == 0)
throw new NoSuchElementException();
T plusGrand = a[0];
for (int i = 1; i < a.length; i++)
   if (plusGrand.compareTo(a[i]) < 0)
     plusGrand = a[i];

Leave a Reply

Your email address will not be published. Required fields are marked *