J
JamesG
Hi, trying to find the largest element in an array as follows:
int[] myArray = {1, 2, 5, 3, 6, 2};
Collection col = new ArrayList(java.util.Arrays.asList(myArray));
Object MAX_E = Collections.max(col);
I have gotten this far, however i'm unsure how to access the result of
the max method. I expected it to return the value of the largest
element, but it seems it's an object?
Any pointers how to achieve this, much appreciated!
int[] myArray = {1, 2, 5, 3, 6, 2};
Collection col = new ArrayList(java.util.Arrays.asList(myArray));
Object MAX_E = Collections.max(col);
I have gotten this far, however i'm unsure how to access the result of
the max method. I expected it to return the value of the largest
element, but it seems it's an object?
Any pointers how to achieve this, much appreciated!