Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yukeehan/d8355f2398f8eaaa1c01a65b6719a211 to your computer and use it in GitHub Desktop.
Save yukeehan/d8355f2398f8eaaa1c01a65b6719a211 to your computer and use it in GitHub Desktop.
public class SelfTest13 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int [] array = {2,7,4,32,67,12,1,48,26};
int max = array[0];
int min = array[0];
for(int v:array) { //for-each for loop
max = max>v? max : v;
min = min<v? min: v;
}
System.out.println(max);
System.out.println(min);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment