public class test {
public int m(int[] a){
int max=a[0];
for(int i=0;i<a.length;i++){
if(max<a[i]){
max=a[i];
}
}
return max;
}
public static void main(String[] args) {
int a[]={12,-1,15,-19,-21};
test t=new test();
System.out.println(t.m(a));
}
}
//做个简单的测试,没用是静态方法.
|