import java.util.*;
public class count {
public int useful(){
System.out.println("用無參帶返回值方法,"
-
"求年齡的最大值?");
int ages[]={26,61,3,89,128,76,34,99};
int max=ages[0];
for (int i = 0; i < ages.length; i++) {
if(ages[i]>max){
max=ages[i];
}
}
return max;
}public static void main(String[] args) {
count doo=new count();
int max=doo.useful();
System.out.println(max);
}
}