int a = iarr[0];
int b = iarr[iarr.length - 1];
if (a > b) {
a = b;
b = iarr[0];
}
for (int i = 1, il = iarr.length; i < il; i++) {
if (iarr[i] < a) {
a = iarr[i];
} else {
if (iarr[i] > b) {
b = iarr[i];
}
}
}
return new int[] { a, b };
}
DecimalFormat df = new DecimalFormat("#");
String rtOverallMax = df.format(max);