Created
February 4, 2018 02:31
-
-
Save yukeehan/d8355f2398f8eaaa1c01a65b6719a211 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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